Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / OpenMP / wsloop-ordered.f90
blob7548d7a597228a29ab2a2cdd719ab6a8debde72e
1 ! This test checks lowering of worksharing-loop construct with ordered clause.
3 ! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck %s
5 ! This checks lowering ordered clause specified without parameter
6 subroutine wsloop_ordered_no_para()
7 integer :: a(10), i
9 ! CHECK: omp.wsloop ordered(0) for (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
10 ! CHECK: omp.yield
11 ! CHECK: }
13 !$omp do ordered
14 do i = 2, 10
15 !$omp ordered
16 a(i) = a(i-1) + 1
17 !$omp end ordered
18 end do
19 !$omp end do
21 end
23 ! This checks lowering ordered clause specified with a parameter
24 subroutine wsloop_ordered_with_para()
25 integer :: a(10), i
27 ! CHECK: func @_QPwsloop_ordered_with_para() {
28 ! CHECK: omp.wsloop ordered(1) for (%{{.*}}) : i32 = (%{{.*}}) to (%{{.*}}) inclusive step (%{{.*}}) {
29 ! CHECK: omp.yield
30 ! CHECK: }
32 !$omp do ordered(1)
33 do i = 2, 10
34 !!$omp ordered depend(sink: i-1)
35 a(i) = a(i-1) + 1
36 !!$omp ordered depend(source)
37 end do
38 !$omp end do
40 end