1 !RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s --check-prefixes="OMPDialect"
2 !RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | FileCheck %s --check-prefix="OMPDialect"
3 !RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | tco | FileCheck %s --check-prefix="LLVMIR"
5 !OMPDialect: omp.critical.declare @help2 hint(none)
6 !OMPDialect: omp.critical.declare @help1 hint(contended)
8 subroutine omp_critical()
11 !OMPDialect: omp.critical(@help1)
12 !LLVMIR: call void @__kmpc_critical_with_hint({{.*}}, {{.*}}, {{.*}} @{{.*}}help1.var, i32 2)
13 !$OMP CRITICAL(help1) HINT(omp_lock_hint_contended)
15 !OMPDialect: omp.terminator
16 !LLVMIR: call void @__kmpc_end_critical({{.*}}, {{.*}}, {{.*}} @{{.*}}help1.var)
17 !$OMP END CRITICAL(help1)
19 ! Test that the same name can be used again
20 ! Also test with the zero hint expression
21 !OMPDialect: omp.critical(@help2)
22 !LLVMIR: call void @__kmpc_critical_with_hint({{.*}}, {{.*}}, {{.*}} @{{.*}}help2.var, i32 0)
23 !$OMP CRITICAL(help2) HINT(omp_lock_hint_none)
25 !OMPDialect: omp.terminator
26 !LLVMIR: call void @__kmpc_end_critical({{.*}}, {{.*}}, {{.*}} @{{.*}}help2.var)
27 !$OMP END CRITICAL(help2)
29 !OMPDialect: omp.critical
30 !LLVMIR: call void @__kmpc_critical({{.*}}, {{.*}}, {{.*}} @{{.*}}_.var)
33 !OMPDialect: omp.terminator
34 !LLVMIR: call void @__kmpc_end_critical({{.*}}, {{.*}}, {{.*}} @{{.*}}_.var)
36 end subroutine omp_critical