Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / OpenMP / wsloop-simd.f90
blob47f9d572a8653636ba2f6d8e2678cfad6383ac7e
1 ! This test checks lowering of OpenMP DO Directive(Worksharing) with
2 ! simd schedule modifier.
4 ! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck %s
6 program wsloop_dynamic
7 integer :: i
8 !CHECK-LABEL: func @_QQmain()
10 !$OMP PARALLEL
11 !CHECK: omp.parallel {
13 !$OMP DO SCHEDULE(simd: runtime)
14 !CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
15 !CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
16 !CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
17 !CHECK: omp.wsloop schedule(runtime, simd) nowait for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
18 !CHECK: fir.store %[[I]] to %[[STORE:.*]] : !fir.ref<i32>
20 do i=1, 9
21 print*, i
22 !CHECK: %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput
23 !CHECK: %[[LOAD:.*]] = fir.load %[[STORE]] : !fir.ref<i32>
24 !CHECK: fir.call @_FortranAioOutputInteger32(%[[RTBEGIN]], %[[LOAD]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
25 !CHECK: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) {{.*}}: (!fir.ref<i8>) -> i32
26 end do
27 !CHECK: omp.yield
28 !CHECK: }
29 !CHECK: omp.terminator
30 !CHECK: }
32 !$OMP END DO NOWAIT
33 !$OMP END PARALLEL
34 end