[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / symbol03.f90
blobeb7d4b303ea410a8e0667fb6fa6875cb2730e5b1
1 ! RUN: %S/test_symbols.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Test host association in internal subroutine of main program.
5 !DEF: /main MainProgram
6 program main
7 !DEF: /main/x ObjectEntity INTEGER(4)
8 integer x
9 !DEF: /main/s (Subroutine) Subprogram
10 call s
11 contains
12 !REF: /main/s
13 subroutine s
14 !DEF: /main/s/y (Implicit) ObjectEntity REAL(4)
15 !DEF: /main/s/x HostAssoc INTEGER(4)
16 y = x
17 contains
18 !DEF: /main/s/s2 (Subroutine) Subprogram
19 subroutine s2
20 !DEF: /main/s/s2/z (Implicit) ObjectEntity REAL(4)
21 !DEF: /main/s/s2/x HostAssoc INTEGER(4)
22 z = x
23 end subroutine
24 end subroutine
25 end program
27 !DEF: /s (Subroutine) Subprogram
28 subroutine s
29 !DEF: /s/x ObjectEntity REAL(4)
30 real x(100, 100)
31 !DEF: /s/s1 (Subroutine) Subprogram
32 call s1
33 contains
34 !REF: /s/s1
35 subroutine s1
36 !DEF: /s/s1/x HostAssoc REAL(4)
37 print *, x(10, 10)
38 end subroutine
39 end subroutine
41 !DEF: /sb (Subroutine) Subprogram
42 subroutine sb
43 !DEF: /sb/x TARGET ObjectEntity REAL(4)
44 real, target :: x
45 !DEF: /sb/s1 (Subroutine) Subprogram
46 call s1
47 contains
48 !REF: /sb/s1
49 subroutine s1
50 !DEF: /sb/s1/p POINTER ObjectEntity REAL(4)
51 real, pointer :: p
52 !REF: /sb/s1/p
53 !DEF: /sb/s1/x TARGET HostAssoc REAL(4)
54 p => x
55 end subroutine
56 end subroutine