Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / do17.f90
blobc0c59f16dee1b6dcbdf44300337124a417bd9332
1 ! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 4.5
3 ! 2.7.1 Do Loop constructs.
5 !DEF: /test MainProgram
6 program test
7 !DEF: /test/i ObjectEntity INTEGER(4)
8 !DEF: /test/j ObjectEntity INTEGER(4)
9 !DEF: /test/k ObjectEntity INTEGER(4)
10 integer i, j, k
11 !$omp do collapse(2)
12 !DEF: /test/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
13 foo: do i=0,10
14 !DEF: /test/OtherConstruct1/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
15 foo1: do j=0,10
16 !REF: /test/k
17 foo2: do k=0,10
18 !REF: /test/OtherConstruct1/i
19 select case (i)
20 case (5)
21 cycle foo1
22 case (7)
23 cycle foo2
24 end select
25 !REF: /test/OtherConstruct1/i
26 !REF: /test/OtherConstruct1/j
27 !REF: /test/k
28 print *, i, j, k
29 end do foo2
30 end do foo1
31 end do foo
33 !$omp do collapse(2)
34 !DEF: /test/OtherConstruct2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
35 foo: do i=0,10
36 !DEF: /test/OtherConstruct2/j (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
37 foo1: do j=0,10
38 !REF: /test/k
39 foo2: do k=0,10
40 !REF: /test/OtherConstruct2/i
41 if (i<3) then
42 cycle foo1
43 !REF: /test/OtherConstruct2/i
44 else if (i>8) then
45 cycle foo1
46 else
47 cycle foo2
48 end if
49 !REF: /test/OtherConstruct2/i
50 !REF: /test/OtherConstruct2/j
51 !REF: /test/k
52 print *, i, j, k
53 end do foo2
54 end do foo1
55 end do foo
56 !$omp end do
57 end program test