[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-do17.f90
blobfb23176309b503abfe913c79e1562900d481735c
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: /test MainProgram
7 program test
8 !DEF: /test/i ObjectEntity INTEGER(4)
9 !DEF: /test/j ObjectEntity INTEGER(4)
10 !DEF: /test/k ObjectEntity INTEGER(4)
11 integer i, j, k
12 !$omp do collapse(2)
13 !DEF: /test/Block1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
14 foo: do i=0,10
15 !DEF: /test/Block1/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
16 foo1: do j=0,10
17 !REF: /test/k
18 foo2: do k=0,10
19 !REF: /test/Block1/i
20 select case (i)
21 case (5)
22 cycle foo1
23 case (7)
24 cycle foo2
25 end select
26 !REF: /test/Block1/i
27 !REF: /test/Block1/j
28 !REF: /test/k
29 print *, i, j, k
30 end do foo2
31 end do foo1
32 end do foo
34 !$omp do collapse(2)
35 !DEF: /test/Block2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
36 foo: do i=0,10
37 !DEF: /test/Block2/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
38 foo1: do j=0,10
39 !REF: /test/k
40 foo2: do k=0,10
41 !REF: /test/Block2/i
42 if (i<3) then
43 cycle foo1
44 !REF: /test/Block2/i
45 else if (i>8) then
46 cycle foo1
47 else
48 cycle foo2
49 end if
50 !REF: /test/Block2/i
51 !REF: /test/Block2/j
52 !REF: /test/k
53 print *, i, j, k
54 end do foo2
55 end do foo1
56 end do foo
57 !$omp end do
58 end program test