Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / canondo04.f90
blobea955230b5ad7de6e349a3d6f81e3dc5b1e0c695
1 ! RUN: %flang_fc1 -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
2 ! CHECK-NOT: do [1-9]
4 ! Figure out how to also execute this test.
6 program main
7 integer :: results(100)
8 integer :: count
9 count = 0
10 if (.true.) then
11 do 1 j1=1,2
12 count = count + 1
13 results(count) = j1
14 1 continue
15 end if
16 do 2 j1=3,4
17 do 2 j2=1,2
18 if (j1 == j2) then
19 do 3 j3=1,2
20 count = count + 1
21 results(count) = 100*j1 + 10*j2 + j3
22 do 3 j4=1,2
24 count = count + 1
25 results(count) = 10*j3 + j4
26 exit
27 end do
28 3 end do
29 else
31 do 4 j3=3,4
32 count = count + 1
33 results(count) = 100*j1 + 10*j2 + j3
34 do 4 j4=3,4
35 count = count + 1
36 results(count) = 10*j3 + j4
37 4 end do
38 exit
39 end do
40 end if
41 count = count + 1
42 results(count) = 10*j1 + j2
43 2 continue
44 do 5 j1=5,6 ! adjacent non-block DO loops
45 count = count + 1
46 5 results(count) = j1
47 do 6 j1=7,8 ! non-block DO loop at end of execution part
48 count = count + 1
49 6 results(count) = j1
50 if (count == 34 .and. sum(results(1:count)) == 3739) then
51 print *, 'pass'
52 else
53 print *, 'FAIL:', count, sum(results(1:count)), results(1:count)
54 end if
55 end