Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ class FunctionDecl : public DeclaratorDecl,
}

void setDefaultedOrDeletedInfo(DefaultedOrDeletedFunctionInfo *Info);
DefaultedOrDeletedFunctionInfo *getDefalutedOrDeletedInfo() const;
DefaultedOrDeletedFunctionInfo *getDefaultedOrDeletedInfo() const;

/// Whether this function is variadic.
bool isVariadic() const;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3180,7 +3180,7 @@ void FunctionDecl::DefaultedOrDeletedFunctionInfo::setDeletedMessage(
}

FunctionDecl::DefaultedOrDeletedFunctionInfo *
FunctionDecl::getDefalutedOrDeletedInfo() const {
FunctionDecl::getDefaultedOrDeletedInfo() const {
return FunctionDeclBits.HasDefaultedOrDeletedInfo ? DefaultedOrDeletedInfo
: nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8035,7 +8035,7 @@ class DefaultedComparisonVisitor {
DefaultedComparisonVisitor(Sema &S, CXXRecordDecl *RD, FunctionDecl *FD,
DefaultedComparisonKind DCK)
: S(S), RD(RD), FD(FD), DCK(DCK) {
if (auto *Info = FD->getDefalutedOrDeletedInfo()) {
if (auto *Info = FD->getDefaultedOrDeletedInfo()) {
// FIXME: Change CreateOverloadedBinOp to take an ArrayRef instead of an
// UnresolvedSet to avoid this copy.
Fns.assign(Info->getUnqualifiedLookups().begin(),
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5465,7 +5465,7 @@ TemplateDeclInstantiator::InitMethodInstantiation(CXXMethodDecl *New,
bool TemplateDeclInstantiator::SubstDefaultedFunction(FunctionDecl *New,
FunctionDecl *Tmpl) {
// Transfer across any unqualified lookups.
if (auto *DFI = Tmpl->getDefalutedOrDeletedInfo()) {
if (auto *DFI = Tmpl->getDefaultedOrDeletedInfo()) {
SmallVector<DeclAccessPair, 32> Lookups;
Lookups.reserve(DFI->getUnqualifiedLookups().size());
bool AnyChanged = false;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Serialization/ASTWriterDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
Record.push_back(D->getODRHash());

if (D->isDefaulted() || D->isDeletedAsWritten()) {
if (auto *FDI = D->getDefalutedOrDeletedInfo()) {
if (auto *FDI = D->getDefaultedOrDeletedInfo()) {
// Store both that there is an DefaultedOrDeletedInfo and whether it
// contains a DeletedMessage.
StringLiteral *DeletedMessage = FDI->getDeletedMessage();
Expand Down
2 changes: 0 additions & 2 deletions flang/lib/Lower/OpenMP/OpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,6 @@ static void genTaskloopClauses(
cp.processPriority(stmtCtx, clauseOps);
cp.processReduction(loc, clauseOps, reductionSyms);
cp.processUntied(clauseOps);

cp.processTODO<clause::Collapse>(loc, llvm::omp::Directive::OMPD_taskloop);
}

static void genTaskwaitClauses(lower::AbstractConverter &converter,
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/charconvert.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ subroutine charconvert3(c, c4)
end subroutine

! CHECK-LABEL: func.func @_QPcharconvert3
! CHECK-SAME: %[[ARG0:.*]]: !fir.boxchar<1> {{.*}}, %[[ARG1:.*]]: !fir.boxchar<4>
! CHECK-SAME: %[[ARG0:.*]]: !fir.boxchar<1> {{.*}}, %[[ARG1:.*]]: !fir.boxchar<4>
! CHECK: %[[VAL_0:.*]]:2 = fir.unboxchar %[[ARG0]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]]#0 typeparams %[[VAL_0]]#1 dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {uniq_name = "_QFcharconvert3Ec"} : (!fir.ref<!fir.char<1,?>>, index, !fir.dscope) -> (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)
! CHECK: %[[VAL_2:.*]]:2 = fir.unboxchar %[[ARG1]] : (!fir.boxchar<4>) -> (!fir.ref<!fir.char<4,?>>, index)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test procedure pointer component default initialization when the size
! of the derived type is 32 bytes and larger.
! of the derived type is 32 bytes and larger.
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

interface
Expand Down
10 changes: 5 additions & 5 deletions flang/test/Lower/HLFIR/procedure-pointer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ real function real_func(x)
real :: x
end function
character(:) function char_func(x)
pointer :: char_func
pointer :: char_func
integer :: x
end function
subroutine sub(x)
Expand Down Expand Up @@ -148,7 +148,7 @@ subroutine sub5()
use m
procedure(real), pointer :: p3

p3 => real_func
p3 => real_func
! CHECK: %[[VAL_0:.*]] = fir.alloca !fir.boxproc<() -> f32> {bindc_name = "p3", uniq_name = "_QFsub5Ep3"}
! CHECK: %[[VAL_1:.*]] = fir.zero_bits () -> f32
! CHECK: %[[VAL_2:.*]] = fir.emboxproc %[[VAL_1]] : (() -> f32) -> !fir.boxproc<() -> f32>
Expand All @@ -165,7 +165,7 @@ subroutine sub6()
procedure(), pointer :: p4
real :: r

p4 => sub
p4 => sub
! CHECK: %[[VAL_0:.*]] = fir.alloca !fir.boxproc<() -> ()> {bindc_name = "p4", uniq_name = "_QFsub6Ep4"}
! CHECK: %[[VAL_1:.*]] = fir.zero_bits () -> ()
! CHECK: %[[VAL_2:.*]] = fir.emboxproc %[[VAL_1]] : (() -> ()) -> !fir.boxproc<() -> ()>
Expand Down Expand Up @@ -197,7 +197,7 @@ subroutine sub7(p1, p2)

call foo2(p2)
! CHECK: fir.call @_QPfoo2(%[[VAL_1]]#0) fastmath<contract> : (!fir.ref<!fir.boxproc<() -> ()>>) -> ()
end
end

subroutine sub8()
use m
Expand Down Expand Up @@ -338,7 +338,7 @@ subroutine sub12()
! CHECK: %[[VAL_16:.*]]:2 = hlfir.declare %[[VAL_0]] {uniq_name = ".tmp.intrinsic_result"} : (!fir.ref<!fir.boxproc<(!fir.ref<i32>) -> !fir.box<!fir.ptr<!fir.char<1,?>>>>>) -> (!fir.ref<!fir.boxproc<(!fir.ref<i32>) -> !fir.box<!fir.ptr<!fir.char<1,?>>>>>, !fir.ref<!fir.boxproc<(!fir.ref<i32>) -> !fir.box<!fir.ptr<!fir.char<1,?>>>>>)
! CHECK: %[[VAL_17:.*]] = fir.convert %[[VAL_16]]#0 : (!fir.ref<!fir.boxproc<(!fir.ref<i32>) -> !fir.box<!fir.ptr<!fir.char<1,?>>>>>) -> !fir.ref<!fir.boxproc<() -> ()>>
! CHECK: fir.call @_QPfoo2(%[[VAL_17]]) fastmath<contract> : (!fir.ref<!fir.boxproc<() -> ()>>) -> ()
end
end

subroutine test_opt_pointer()
interface
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/reshape.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end subroutine reshape_test_nopad
! CHECK: %[[VAL_10:.*]]:2 = hlfir.declare {{.*}}{uniq_name = "_QFreshape_test_nopadEsh"} : (!fir.ref<!fir.array<2xi32>>, !fir.shape<1>, !fir.dscope) -> (!fir.ref<!fir.array<2xi32>>, !fir.ref<!fir.array<2xi32>>)
! CHECK: %[[VAL_11:.*]]:2 = hlfir.declare {{.*}}{uniq_name = "_QFreshape_test_nopadEsource"} : (!fir.box<!fir.array<?x?x?xi32>>, !fir.dscope) -> (!fir.box<!fir.array<?x?x?xi32>>, !fir.box<!fir.array<?x?x?xi32>>)
! CHECK: %[[VAL_13:.*]] = hlfir.reshape %[[VAL_11]]#0 %[[VAL_10]]#0 order %[[VAL_7]]#0 : (!fir.box<!fir.array<?x?x?xi32>>, !fir.ref<!fir.array<2xi32>>, !fir.ref<!fir.array<2xi32>>) -> !hlfir.expr<?x?xi32>

subroutine test_reshape_optional1(pad, order, source, shape)
real, pointer :: pad(:, :)
integer, pointer :: order(:)
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Lower/MIF/co_broadcast.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ program test_co_broadcast
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_I:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<2xi32>>
! CHECK: mif.co_broadcast %[[V1]] source %[[C1_i32:.*]] : (!fir.box<!fir.array<2xi32>>, i32)
call co_broadcast(array_i, source_image=1)

! CHECK: %[[C1_i32:.*]] = arith.constant 1 : i32
! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_C:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xcomplex<f32>>>, !fir.shape<1>) -> !fir.box<!fir.array<2xcomplex<f32>>>
! CHECK: mif.co_broadcast %[[V1]] source %[[C1_i32:.*]] : (!fir.box<!fir.array<2xcomplex<f32>>>, i32)
call co_broadcast(array_c, source_image=1)

! CHECK: %[[C1_i32:.*]] = arith.constant 1 : i32
! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_D:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xf64>>, !fir.shape<1>) -> !fir.box<!fir.array<2xf64>>
Expand Down
6 changes: 3 additions & 3 deletions flang/test/Lower/MIF/co_max.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ program test_co_max
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_I:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<2xi32>>
! CHECK: mif.co_max %[[V1]] : (!fir.box<!fir.array<2xi32>>)
call co_max(array_i)

! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_C:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2x!fir.char<1>>>, !fir.shape<1>) -> !fir.box<!fir.array<2x!fir.char<1>>>
! CHECK: mif.co_max %[[V1]] result %[[C1_i32:.*]] : (!fir.box<!fir.array<2x!fir.char<1>>>, i32)
call co_max(array_c, result_image=1)
call co_max(array_c, result_image=1)

! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_D:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xf64>>, !fir.shape<1>) -> !fir.box<!fir.array<2xf64>>
! CHECK: mif.co_max %[[V1]] result %[[C1_i32:.*]] stat %[[STATUS:.*]]#0 : (!fir.box<!fir.array<2xf64>>, i32, !fir.ref<i32>)
Expand Down
6 changes: 3 additions & 3 deletions flang/test/Lower/MIF/co_min.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ program test_co_min
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_I:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<2xi32>>
! CHECK: mif.co_min %[[V1]] : (!fir.box<!fir.array<2xi32>>)
call co_min(array_i)

! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_C:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2x!fir.char<1>>>, !fir.shape<1>) -> !fir.box<!fir.array<2x!fir.char<1>>>
! CHECK: mif.co_min %[[V1]] result %[[C1_i32:.*]] : (!fir.box<!fir.array<2x!fir.char<1>>>, i32)
call co_min(array_c, result_image=1)
call co_min(array_c, result_image=1)

! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_D:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xf64>>, !fir.shape<1>) -> !fir.box<!fir.array<2xf64>>
! CHECK: mif.co_min %[[V1]] result %[[C1_i32:.*]] stat %[[STATUS:.*]]#0 : (!fir.box<!fir.array<2xf64>>, i32, !fir.ref<i32>)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/MIF/co_sum.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ program test_co_sum
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_I:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<2xi32>>
! CHECK: mif.co_sum %[[V1]] : (!fir.box<!fir.array<2xi32>>)
call co_sum(array_i)

! CHECK: %[[SHAPE_2:.*]] = fir.shape %[[C2_2:.*]] : (index) -> !fir.shape<1>
! CHECK: %[[V1:.*]] = fir.embox %[[ARRAY_D:.*]]#0(%[[SHAPE_2]]) : (!fir.ref<!fir.array<2xf64>>, !fir.shape<1>) -> !fir.box<!fir.array<2xf64>>
! CHECK: mif.co_sum %[[V1]] result %[[C1_i32:.*]] stat %[[STATUS:.*]]#0 : (!fir.box<!fir.array<2xf64>>, i32, !fir.ref<i32>)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/MIF/coarray-init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

program test_init

end
end

! ALL-LABEL: func.func @main
! ALL: fir.call @_FortranAProgramStart
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/MIF/num_images.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
program test
use iso_fortran_env
integer :: i
integer :: team_number
integer :: team_number
type(team_type) :: team

! CHECK: mif.num_images : () -> i32
Expand Down
6 changes: 3 additions & 3 deletions flang/test/Lower/MIF/sync_all.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
program test_sync_all
implicit none
! NOCOARRAY: Not yet implemented: Multi-image features are experimental and are disabled by default, use '-fcoarray' to enable.

! COARRAY: %[[ERRMSG:.*]]:2 = hlfir.declare %[[VAL_1:.*]] typeparams %[[C_128:.*]] {uniq_name = "_QFEerror_message"} : (!fir.ref<!fir.char<1,128>>, index) -> (!fir.ref<!fir.char<1,128>>, !fir.ref<!fir.char<1,128>>)
! COARRAY: %[[STAT:.*]]:2 = hlfir.declare %[[VAL_2:.*]] {uniq_name = "_QFEsync_status"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
integer sync_status
Expand All @@ -15,11 +15,11 @@ program test_sync_all

! COARRAY: mif.sync_all stat %[[STAT]]#0 : (!fir.ref<i32>)
sync all(stat=sync_status)

! COARRAY: %[[VAL_1:.*]] = fir.embox %[[ERRMSG]]#0 : (!fir.ref<!fir.char<1,128>>) -> !fir.box<!fir.char<1,128>>
! COARRAY: mif.sync_all errmsg %[[VAL_1]] : (!fir.box<!fir.char<1,128>>)
sync all( errmsg=error_message)

! COARRAY: %[[VAL_2:.*]] = fir.embox %[[ERRMSG]]#0 : (!fir.ref<!fir.char<1,128>>) -> !fir.box<!fir.char<1,128>>
! COARRAY: mif.sync_all stat %[[STAT]]#0 errmsg %[[VAL_2]] : (!fir.ref<i32>, !fir.box<!fir.char<1,128>>)
sync all(stat=sync_status, errmsg=error_message)
Expand Down
8 changes: 4 additions & 4 deletions flang/test/Lower/MIF/sync_images.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
program test_sync_images
implicit none
! NOCOARRAY: Not yet implemented: Multi-image features are experimental and are disabled by default, use '-fcoarray' to enable.

! COARRAY: %[[ERRMSG:.*]]:2 = hlfir.declare %[[VAL_1:.*]] typeparams %[[C_128:.*]] {uniq_name = "_QFEerror_message"} : (!fir.ref<!fir.char<1,128>>, index) -> (!fir.ref<!fir.char<1,128>>, !fir.ref<!fir.char<1,128>>)
! COARRAY: %[[ME:.*]]:2 = hlfir.declare %[[VAL_3:.*]] {uniq_name = "_QFEme"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
! COARRAY: %[[STAT:.*]]:2 = hlfir.declare %[[VAL_2:.*]] {uniq_name = "_QFEsync_status"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
Expand All @@ -24,14 +24,14 @@ program test_sync_images
! COARRAY: %[[VAL_5:.*]] = fir.embox %[[IMG_SET:.*]]#0(%[[SHAPE_1:.*]]) : (!fir.ref<!fir.array<1xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<1xi32>>
! COARRAY: mif.sync_images image_set %[[VAL_5]] stat %[[STAT]]#0 errmsg %[[VAL_4]] : (!fir.box<!fir.array<1xi32>>, !fir.ref<i32>, !fir.box<!fir.char<1,128>>)
sync images([1], stat=sync_status, errmsg=error_message)

! COARRAY: mif.sync_images : ()
sync images(*)

! COARRAY: %[[VAL_6:.*]] = fir.embox %[[ME]]#0 : (!fir.ref<i32>) -> !fir.box<i32>
! COARRAY: mif.sync_images image_set %[[VAL_6]] : (!fir.box<i32>)
sync images(me)

! COARRAY: %[[VAL_7:.*]] = fir.embox %[[IMG_SET:.*]]#0(%[[SHAPE_3:.*]]) : (!fir.ref<!fir.array<1xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<1xi32>>
! COARRAY: mif.sync_images image_set %[[VAL_7]] : (!fir.box<!fir.array<1xi32>>)
sync images([1])
Expand Down
8 changes: 4 additions & 4 deletions flang/test/Lower/MIF/sync_memory.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
program test_sync_memory
implicit none
! NOCOARRAY: Not yet implemented: Multi-image features are experimental and are disabled by default, use '-fcoarray' to enable.

! COARRAY: %[[ERRMSG:.*]]:2 = hlfir.declare %[[VAL_1:.*]] typeparams %[[C_128:.*]] {uniq_name = "_QFEerror_message"} : (!fir.ref<!fir.char<1,128>>, index) -> (!fir.ref<!fir.char<1,128>>, !fir.ref<!fir.char<1,128>>)
! COARRAY: %[[STAT:.*]]:2 = hlfir.declare %[[VAL_2:.*]] {uniq_name = "_QFEsync_status"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
integer sync_status
character(len=128) :: error_message

! COARRAY: mif.sync_memory : ()
! COARRAY: mif.sync_memory : ()
sync memory

! COARRAY: mif.sync_memory stat %[[STAT]]#0 : (!fir.ref<i32>)
sync memory(stat=sync_status)

! COARRAY: %[[VAL_1:.*]] = fir.embox %[[ERRMSG]]#0 : (!fir.ref<!fir.char<1,128>>) -> !fir.box<!fir.char<1,128>>
! COARRAY: mif.sync_memory errmsg %[[VAL_1]] : (!fir.box<!fir.char<1,128>>)
sync memory( errmsg=error_message)

! COARRAY: %[[VAL_2:.*]] = fir.embox %[[ERRMSG]]#0 : (!fir.ref<!fir.char<1,128>>) -> !fir.box<!fir.char<1,128>>
! COARRAY: mif.sync_memory stat %[[STAT]]#0 errmsg %[[VAL_2]] : (!fir.ref<i32>, !fir.box<!fir.char<1,128>>)
sync memory(stat=sync_status, errmsg=error_message)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/MIF/this_image.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ program test
integer :: i
type(team_type) :: team

! CHECK: mif.this_image : () -> i32
! CHECK: mif.this_image : () -> i32
i = this_image()

! CHECK: mif.this_image team %[[TEAM:.*]] : ({{.*}}) -> i32
Expand Down
15 changes: 0 additions & 15 deletions flang/test/Lower/OpenMP/Todo/taskloop-collapse.f90

This file was deleted.

34 changes: 34 additions & 0 deletions flang/test/Lower/OpenMP/taskloop-collapse.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
! Test the collapse clause when being used with the taskloop construct
! RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=45 %s -o - 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=45 %s -o - 2>&1 | FileCheck %s

! CHECK-LABEL: omp.private
! CHECK-SAME: {type = private} @[[J_PRIVATE:.*]] : i32
! CHECK-LABEL: omp.private
! CHECK-SAME: {type = private} @[[I_PRIVATE:.*]] : i32
! CHECK-LABEL: omp.private
! CHECK-SAME: {type = firstprivate} @[[SUM_FIRSTPRIVATE:.*]] : i32 copy

! CHECK-LABEL: func.func @_QPtest()
! CHECK: %[[ALLOCA_I:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtestEi"}
! CHECK: %[[DECLARE_I:.*]]:2 = hlfir.declare %1 {uniq_name = "_QFtestEi"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
! CHECK: %[[ALLOCA_J:.*]] = fir.alloca i32 {bindc_name = "j", uniq_name = "_QFtestEj"}
! CHECK: %[[DECLARE_J:.*]]:2 = hlfir.declare %3 {uniq_name = "_QFtestEj"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
! CHECK: %[[ALLOCA_SUM:.*]] = fir.alloca i32 {bindc_name = "sum", uniq_name = "_QFtestEsum"}
! CHECK: %[[DECLARE_SUM:.*]]:2 = hlfir.declare %5 {uniq_name = "_QFtestEsum"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)

subroutine test()
integer :: i, j, sum

!$omp taskloop collapse(2)
! CHECK-LABEL: omp.taskloop
! CHECK-SAME: private(@_QFtestEsum_firstprivate_i32 %[[DECLARE_SUM]]#0 -> %arg0, @_QFtestEi_private_i32 %[[DECLARE_I]]#0 -> %arg1, @_QFtestEj_private_i32 %[[DECLARE_J]]#0 -> %arg2 : !fir.ref<i32>, !fir.ref<i32>, !fir.ref<i32>)
! CHECK-LABEL: omp.loop_nest
! CHECK-SAME: (%arg3, %arg4) : i32 = (%c1_i32, %c1_i32_1) to (%c10_i32, %c5_i32) inclusive step (%c1_i32_0, %c1_i32_2) collapse(2)
do i = 1, 10
do j = 1, 5
sum = sum + i + j
end do
end do
!$omp end taskloop
end subroutine
15 changes: 15 additions & 0 deletions flang/test/Semantics/OpenMP/taskloop04.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
! When lowering Taskloop, it is possible for the TileSizes clause to be lowered, but this is not a supported clause.
! We should make sure that any use of Tilesizes with Taskloop is correctly rejected by the Semantics.
! RUN: %python %S/../test_errors.py %s %flang -fopenmp

subroutine test
integer :: i, sum

!ERROR: TILE cannot follow TASKLOOP
!ERROR: SIZES clause is not allowed on the TASKLOOP directive
!$omp taskloop tile sizes(2)
do i=1,10
sum = sum + i
end do
!$omp end taskloop
end subroutine
Loading