xref: /llvm-project/flang/test/Examples/omp-order-clause.f90 (revision 00ab44ee66dbcf0d32819dbc6e4eefd1b7c48dfa)
1! REQUIRES: plugins, examples, shell
2
3! RUN: %flang_fc1 -load %llvmshlibdir/flangOmpReport.so -plugin flang-omp-report -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s
4
5! Check for ORDER([order-modifier :]concurrent) clause on OpenMP constructs
6
7subroutine test_order()
8 integer :: i, j = 1
9 !$omp do order(concurrent)
10 do i=1,10
11  j = j + 1
12 end do
13 !$omp end do
14end subroutine
15
16!CHECK: - file:         {{.*}}
17!CHECK:   line:         9
18!CHECK:   construct:    do
19!CHECK:   clauses:
20!CHECK:     - clause:   order
21!CHECK:       details:  concurrent
22
23subroutine test_order_reproducible()
24 integer :: i, j = 1
25 !$omp simd order(reproducible:concurrent)
26 do i=1,10
27  j = j + 1
28 end do
29 !$omp end simd
30end subroutine
31
32!CHECK: - file:         {{.*}}
33!CHECK:   line:         25
34!CHECK:   construct:    simd
35!CHECK:   clauses:
36!CHECK:     - clause:   order
37!CHECK:       details:  'reproducible:concurrent'
38
39subroutine test_order_unconstrained()
40 integer :: i, j = 1
41 !$omp target teams distribute parallel do simd order(unconstrained:concurrent)
42 do i=1,10
43  j = j + 1
44 end do
45 !$omp end target teams distribute parallel do simd
46end subroutine
47
48!CHECK: - file:         {{.*}}
49!CHECK:   line:         41
50!CHECK:   construct:    target teams distribute parallel do simd
51!CHECK:   clauses:
52!CHECK:     - clause:   order
53!CHECK:       details:  'unconstrained:concurrent'
54