Files
clang-p2996/flang/test/Lower/OpenMP/FIR/ordered-threads.f90
jeanPerier f35f863a88 [flang][NFC] Use hlfir=false and flang-deprecated-no-hlfir in legacy tests (#71957)
Patch 2/3 of the transition step 1 described in

https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7.

All the modified tests are still here since coverage for the direct
lowering to FIR was still needed while it was default. Some already have
an HLFIR version, some have not and will need to be ported in step 2
described in the RFC.

Note that another 147 lit tests use -emit-fir/-emit-llvm outputs but do
not need a flag since the HLFIR/no HLFIR output is the same for what is
being tested.
2023-11-13 09:14:05 +01:00

41 lines
1.5 KiB
Fortran

! This test checks lowering of OpenMP ordered directive with threads Clause.
! Without clause in ordered direcitve, it behaves as if threads clause is
! specified.
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | FileCheck %s --check-prefix=FIRDialect
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | FileCheck %s --check-prefix=LLVMIRDialect
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | tco | FileCheck %s --check-prefix=LLVMIR
subroutine ordered
integer :: i
integer :: a(20)
!FIRDialect: omp.ordered_region {
!LLVMIRDialect: omp.ordered_region {
!LLVMIR: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB0:[0-9]+]])
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
!$OMP ORDERED
a(i) = a(i-1) + 1
!FIRDialect: omp.terminator
!FIRDialect-NEXT: }
!LLVMIRDialect: omp.terminator
!LLVMIRDialect-NEXT: }
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
!$OMP END ORDERED
!FIRDialect: omp.ordered_region {
!LLVMIRDialect: omp.ordered_region {
!LLVMIR: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
!$OMP ORDERED THREADS
a(i) = a(i-1) + 1
!FIRDialect: omp.terminator
!FIRDialect-NEXT: }
!LLVMIRDialect: omp.terminator
!LLVMIRDialect-NEXT: }
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
!LLVMIR-NEXT: ret void
!$OMP END ORDERED
end