[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / modfile17.f90
blobc15765e8aa01a4629cbf50517cfe1e67eac39b0e
1 ! RUN: %S/test_modfile.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Tests parameterized derived type instantiation with KIND parameters
5 module m
6 type :: capture(k1,k2,k4,k8)
7 integer(kind=1), kind :: k1
8 integer(kind=2), kind :: k2
9 integer(kind=4), kind :: k4
10 integer(kind=8), kind :: k8
11 integer(kind=k1) :: j1
12 integer(kind=k2) :: j2
13 integer(kind=k4) :: j4
14 integer(kind=k8) :: j8
15 end type capture
16 type :: defaulted(n1,n2,n4,n8)
17 integer(kind=1), kind :: n1 = 1
18 integer(kind=2), kind :: n2 = n1 * 2
19 integer(kind=4), kind :: n4 = 2 * n2
20 integer(kind=8), kind :: n8 = 12 - n4
21 type(capture(n1,n2,n4,n8)) :: cap
22 end type defaulted
23 type, extends(defaulted) :: extension(k5)
24 integer(kind=4), kind :: k5 = 4
25 integer(kind=k5) :: j5
26 end type extension
27 type(capture(1,1,1,1)) :: x1111
28 integer(kind=x1111%j1%kind) :: res01_1
29 integer(kind=x1111%j2%kind) :: res02_1
30 integer(kind=x1111%j4%kind) :: res03_1
31 integer(kind=x1111%j8%kind) :: res04_1
32 type(capture(8,8,8,8)) :: x8888
33 integer(kind=x8888%j1%kind) :: res05_8
34 integer(kind=x8888%j2%kind) :: res06_8
35 integer(kind=x8888%j4%kind) :: res07_8
36 integer(kind=x8888%j8%kind) :: res08_8
37 type(capture(2,k8=1,k4=8,k2=4)) :: x2481
38 integer(kind=x2481%j1%kind) :: res09_2
39 integer(kind=x2481%j2%kind) :: res10_4
40 integer(kind=x2481%j4%kind) :: res11_8
41 integer(kind=x2481%j8%kind) :: res12_1
42 type(capture(2,1,k4=8,k8=4)) :: x2184
43 integer(kind=x2184%j1%kind) :: res13_2
44 integer(kind=x2184%j2%kind) :: res14_1
45 integer(kind=x2184%j4%kind) :: res15_8
46 integer(kind=x2184%j8%kind) :: res16_4
47 type(defaulted) :: x1248
48 integer(kind=x1248%cap%j1%kind) :: res17_1
49 integer(kind=x1248%cap%j2%kind) :: res18_2
50 integer(kind=x1248%cap%j4%kind) :: res19_4
51 integer(kind=x1248%cap%j8%kind) :: res20_8
52 type(defaulted(2)) :: x2484
53 integer(kind=x2484%cap%j1%kind) :: res21_2
54 integer(kind=x2484%cap%j2%kind) :: res22_4
55 integer(kind=x2484%cap%j4%kind) :: res23_8
56 integer(kind=x2484%cap%j8%kind) :: res24_4
57 type(defaulted(n8=2)) :: x1242
58 integer(kind=x1242%cap%j1%kind) :: res25_1
59 integer(kind=x1242%cap%j2%kind) :: res26_2
60 integer(kind=x1242%cap%j4%kind) :: res27_4
61 integer(kind=x1242%cap%j8%kind) :: res28_2
62 type(extension(1,1,1,1,1)) :: x11111
63 integer(kind=x11111%defaulted%cap%j1%kind) :: res29_1
64 integer(kind=x11111%cap%j2%kind) :: res30_1
65 integer(kind=x11111%cap%j4%kind) :: res31_1
66 integer(kind=x11111%cap%j8%kind) :: res32_1
67 integer(kind=x11111%j5%kind) :: res33_1
68 type(extension(2,8,4,1,8)) :: x28418
69 integer(kind=x28418%defaulted%cap%j1%kind) :: res34_2
70 integer(kind=x28418%cap%j2%kind) :: res35_8
71 integer(kind=x28418%cap%j4%kind) :: res36_4
72 integer(kind=x28418%cap%j8%kind) :: res37_1
73 integer(kind=x28418%j5%kind) :: res38_8
74 type(extension(8,n8=1,k5=2,n2=4,n4=8)) :: x84812
75 integer(kind=x84812%defaulted%cap%j1%kind) :: res39_8
76 integer(kind=x84812%cap%j2%kind) :: res40_4
77 integer(kind=x84812%cap%j4%kind) :: res41_8
78 integer(kind=x84812%cap%j8%kind) :: res42_1
79 integer(kind=x84812%j5%kind) :: res43_2
80 type(extension(k5=2)) :: x12482
81 integer(kind=x12482%defaulted%cap%j1%kind) :: res44_1
82 integer(kind=x12482%cap%j2%kind) :: res45_2
83 integer(kind=x12482%cap%j4%kind) :: res46_4
84 integer(kind=x12482%cap%j8%kind) :: res47_8
85 integer(kind=x12482%j5%kind) :: res48_2
86 end module
88 !Expect: m.mod
89 !module m
90 !type::capture(k1,k2,k4,k8)
91 !integer(1),kind::k1
92 !integer(2),kind::k2
93 !integer(4),kind::k4
94 !integer(8),kind::k8
95 !integer(int(int(k1,kind=1),kind=8))::j1
96 !integer(int(int(k2,kind=2),kind=8))::j2
97 !integer(int(int(k4,kind=4),kind=8))::j4
98 !integer(k8)::j8
99 !end type
100 !type::defaulted(n1,n2,n4,n8)
101 !integer(1),kind::n1=1_1
102 !integer(2),kind::n2=int(2_4*int(int(n1,kind=1),kind=4),kind=2)
103 !integer(4),kind::n4=2_4*int(int(n2,kind=2),kind=4)
104 !integer(8),kind::n8=int(12_4-int(n4,kind=4),kind=8)
105 !type(capture(k1=int(n1,kind=1),k2=int(n2,kind=2),k4=int(n4,kind=4),k8=n8))::cap
106 !end type
107 !type,extends(defaulted)::extension(k5)
108 !integer(4),kind::k5=4_4
109 !integer(int(int(k5,kind=4),kind=8))::j5
110 !end type
111 !type(capture(k1=1_1,k2=1_2,k4=1_4,k8=1_8))::x1111
112 !integer(1)::res01_1
113 !integer(1)::res02_1
114 !integer(1)::res03_1
115 !integer(1)::res04_1
116 !type(capture(k1=8_1,k2=8_2,k4=8_4,k8=8_8))::x8888
117 !integer(8)::res05_8
118 !integer(8)::res06_8
119 !integer(8)::res07_8
120 !integer(8)::res08_8
121 !type(capture(k1=2_1,k2=4_2,k4=8_4,k8=1_8))::x2481
122 !integer(2)::res09_2
123 !integer(4)::res10_4
124 !integer(8)::res11_8
125 !integer(1)::res12_1
126 !type(capture(k1=2_1,k2=1_2,k4=8_4,k8=4_8))::x2184
127 !integer(2)::res13_2
128 !integer(1)::res14_1
129 !integer(8)::res15_8
130 !integer(4)::res16_4
131 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x1248
132 !integer(1)::res17_1
133 !integer(2)::res18_2
134 !integer(4)::res19_4
135 !integer(8)::res20_8
136 !type(defaulted(n1=2_1,n2=4_2,n4=8_4,n8=4_8))::x2484
137 !integer(2)::res21_2
138 !integer(4)::res22_4
139 !integer(8)::res23_8
140 !integer(4)::res24_4
141 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=2_8))::x1242
142 !integer(1)::res25_1
143 !integer(2)::res26_2
144 !integer(4)::res27_4
145 !integer(2)::res28_2
146 !type(extension(k5=1_4,n1=1_1,n2=1_2,n4=1_4,n8=1_8))::x11111
147 !integer(1)::res29_1
148 !integer(1)::res30_1
149 !integer(1)::res31_1
150 !integer(1)::res32_1
151 !integer(1)::res33_1
152 !type(extension(k5=8_4,n1=2_1,n2=8_2,n4=4_4,n8=1_8))::x28418
153 !integer(2)::res34_2
154 !integer(8)::res35_8
155 !integer(4)::res36_4
156 !integer(1)::res37_1
157 !integer(8)::res38_8
158 !type(extension(k5=2_4,n1=8_1,n2=4_2,n4=8_4,n8=1_8))::x84812
159 !integer(8)::res39_8
160 !integer(4)::res40_4
161 !integer(8)::res41_8
162 !integer(1)::res42_1
163 !integer(2)::res43_2
164 !type(extension(k5=2_4,n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x12482
165 !integer(1)::res44_1
166 !integer(2)::res45_2
167 !integer(4)::res46_4
168 !integer(8)::res47_8
169 !integer(2)::res48_2
170 !end