[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-do12.f90
blob264eb15df8cad64ebcc4e69002bc4aac831754d3
1 ! RUN: %S/test_symbols.sh %s %t %flang_fc1 -fopenmp
2 ! REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.7.1 Do Loop constructs.
6 !DEF: /omp_cycle MainProgram
7 program omp_cycle
8 !$omp do collapse(1)
9 !DEF: /omp_cycle/Block1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
10 do i=0,10
11 !REF: /omp_cycle/Block1/i
12 if (i<1) cycle
13 !DEF: /omp_cycle/j (Implicit) ObjectEntity INTEGER(4)
14 do j=0,10
15 !DEF: /omp_cycle/k (Implicit) ObjectEntity INTEGER(4)
16 do k=0,10
17 !REF: /omp_cycle/Block1/i
18 !REF: /omp_cycle/j
19 !REF: /omp_cycle/k
20 print *, i, j, k
21 end do
22 end do
23 end do
24 !$omp end do
26 !$omp do collapse(1)
27 !DEF: /omp_cycle/Block2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
28 do i=0,10
29 !REF: /omp_cycle/j
30 do j=0,10
31 !REF: /omp_cycle/Block2/i
32 if (i<1) cycle
33 !REF: /omp_cycle/k
34 do k=0,10
35 !REF: /omp_cycle/Block2/i
36 !REF: /omp_cycle/j
37 !REF: /omp_cycle/k
38 print *, i, j, k
39 end do
40 end do
41 end do
42 !$omp end do
44 !$omp do collapse(2)
45 !DEF: /omp_cycle/Block3/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
46 do i=0,10
47 !DEF: /omp_cycle/Block3/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
48 do j=0,10
49 !REF: /omp_cycle/k
50 do k=0,10
51 !REF: /omp_cycle/Block3/i
52 if (i<1) cycle
53 !REF: /omp_cycle/Block3/i
54 !REF: /omp_cycle/Block3/j
55 !REF: /omp_cycle/k
56 print *, i, j, k
57 end do
58 end do
59 end do
60 !$omp end do
62 !$omp do collapse(3)
63 !DEF: /omp_cycle/Block4/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
64 do i=0,10
65 !DEF: /omp_cycle/Block4/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
66 do j=0,10
67 !DEF: /omp_cycle/Block4/k (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
68 do k=0,10
69 !REF: /omp_cycle/Block4/i
70 if (i<1) cycle
71 !REF: /omp_cycle/Block4/i
72 !REF: /omp_cycle/Block4/j
73 !REF: /omp_cycle/Block4/k
74 print *, i, j, k
75 end do
76 end do
77 end do
78 !$omp end do
80 !$omp do collapse(3)
81 !DEF: /omp_cycle/Block5/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
82 foo:do i=0,10
83 !DEF: /omp_cycle/Block5/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
84 foo1:do j=0,10
85 !DEF: /omp_cycle/Block5/k (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
86 foo2:do k=0,10
87 !REF: /omp_cycle/Block5/i
88 if (i<1) cycle foo2
89 !REF: /omp_cycle/Block5/i
90 !REF: /omp_cycle/Block5/j
91 !REF: /omp_cycle/Block5/k
92 print *, i, j, k
93 end do foo2
94 end do foo1
95 end do foo
96 !$omp end do
97 end program omp_cycle