[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-do-ordered.f90
blob77a8476394970b00464191e991cc398b2efec795
1 !RUN: %python %S/test_errors.py %s %flang -fopenmp
2 ! OpenMP Version 4.5
3 ! 2.7.1 Ordered Clause
5 program omp_doOrdered
6 integer:: i,j
7 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
8 !$omp do ordered(3)
9 do i = 1,10
10 do j = 1, 10
11 print *, "hello"
12 end do
13 end do
14 !$omp end do
16 do i = 1,10
17 do j = 1, 10
18 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
19 !$omp do ordered(2)
20 do k = 1, 10
21 print *, "hello"
22 end do
23 !$omp end do
24 end do
25 end do
27 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
28 !$omp do ordered(2)
29 do i = 1,10
30 !$omp ordered
31 do j = 1, 10
32 print *, "hello"
33 end do
34 !$omp end ordered
35 end do
36 !$omp end do
38 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
39 !$omp do collapse(1) ordered(3)
40 do i = 1,10
41 do j = 1, 10
42 print *, "hello"
43 end do
44 end do
45 !$omp end do
47 !$omp parallel num_threads(4)
48 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
49 !$omp do ordered(2) collapse(1)
50 do i = 1,10
51 !$omp ordered
52 do j = 1, 10
53 print *, "hello"
54 end do
55 !$omp end ordered
56 end do
57 !$omp end parallel
58 end program omp_doOrdered