[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / symbol05.f90
blobfacaef5e01d542a094667aa2c46f054315c8374c
1 ! RUN: %S/test_symbols.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Explicit and implicit entities in blocks
5 !DEF: /s1 (Subroutine) Subprogram
6 subroutine s1
7 !DEF: /s1/x ObjectEntity INTEGER(4)
8 integer x
9 block
10 !DEF: /s1/Block1/y ObjectEntity INTEGER(4)
11 integer y
12 !REF: /s1/x
13 x = 1
14 !REF: /s1/Block1/y
15 y = 2.0
16 end block
17 block
18 !DEF: /s1/Block2/y ObjectEntity REAL(4)
19 real y
20 !REF: /s1/Block2/y
21 y = 3.0
22 end block
23 end subroutine
25 !DEF: /s2 (Subroutine) Subprogram
26 subroutine s2
27 implicit integer(w-x)
28 block
29 !DEF: /s2/x (Implicit) ObjectEntity INTEGER(4)
30 x = 1
31 !DEF: /s2/y (Implicit) ObjectEntity REAL(4)
32 y = 2
33 end block
34 contains
35 !DEF: /s2/s (Subroutine) Subprogram
36 subroutine s
37 !DEF: /s2/s/x (Implicit) HostAssoc INTEGER(4)
38 x = 1
39 !DEF: /s2/s/w (Implicit) ObjectEntity INTEGER(4)
40 w = 1
41 end subroutine
42 end subroutine
44 !DEF: /s3 (Subroutine) Subprogram
45 subroutine s3
46 !DEF: /s3/j ObjectEntity INTEGER(8)
47 integer(kind=8) j
48 block
49 !DEF: /s3/Block1/t DerivedType
50 type :: t
51 !DEF: /s3/Block1/t/x ObjectEntity REAL(4)
52 !DEF: /s3/Block1/t/ImpliedDos1/ImpliedDos1/i (Implicit) ObjectEntity INTEGER(4)
53 real :: x(10) = [(i, i=1,10)]
54 !DEF: /s3/Block1/t/y ObjectEntity REAL(4)
55 !DEF: /s3/Block1/t/ImpliedDos2/ImpliedDos1/j ObjectEntity INTEGER(8)
56 real :: y(10) = [(j, j=1,10)]
57 end type
58 end block
59 end subroutine
61 !DEF: /s4 (Subroutine) Subprogram
62 subroutine s4
63 implicit integer(x)
64 interface
65 !DEF: /s4/s EXTERNAL (Subroutine) Subprogram
66 !DEF: /s4/s/x (Implicit) ObjectEntity REAL(4)
67 !DEF: /s4/s/y (Implicit) ObjectEntity INTEGER(4)
68 subroutine s (x, y)
69 implicit integer(y)
70 end subroutine
71 end interface
72 end subroutine
74 !DEF: /s5 (Subroutine) Subprogram
75 subroutine s5
76 block
77 !DEF: /s5/Block1/x (Implicit) ObjectEntity REAL(4)
78 dimension :: x(2)
79 block
80 !DEF: /s5/Block1/Block1/x (Implicit) ObjectEntity REAL(4)
81 dimension :: x(3)
82 end block
83 end block
84 !DEF: /s5/x (Implicit) ObjectEntity REAL(4)
85 x = 1.0
86 end subroutine
88 !DEF: /s6 (Subroutine) Subprogram
89 subroutine s6
90 !DEF: /s6/i ObjectEntity INTEGER(4)
91 !DEF: /s6/j ObjectEntity INTEGER(4)
92 !DEF: /s6/k ObjectEntity INTEGER(4)
93 integer i, j, k
94 block
95 !DEF: /s6/Block1/i ASYNCHRONOUS, VOLATILE HostAssoc INTEGER(4)
96 volatile :: i
97 !DEF: /s6/Block1/j ASYNCHRONOUS HostAssoc INTEGER(4)
98 asynchronous :: j
99 !REF: /s6/Block1/i
100 asynchronous :: i
101 !DEF: /s6/Block1/k TARGET (Implicit) ObjectEntity INTEGER(4)
102 target :: k
103 end block
104 end subroutine
106 !DEF: /m7 Module
107 module m7
108 !DEF: /m7/i PUBLIC ObjectEntity INTEGER(4)
109 !DEF: /m7/j PUBLIC ObjectEntity INTEGER(4)
110 integer i, j
111 end module
112 !DEF: /s7 (Subroutine) Subprogram
113 subroutine s7
114 !REF: /m7
115 use :: m7
116 !DEF: /s7/j VOLATILE Use INTEGER(4)
117 volatile :: j
118 end subroutine