1 ! RUN: %python %S/test_modfile.py %s %flang_fc1
2 ! Tests parameterized derived type instantiation with KIND parameters
5 type :: capture(k1
,k2
,k4
,k8
)
6 integer(kind
=1), kind
:: k1
7 integer(kind
=2), kind
:: k2
8 integer(kind
=4), kind
:: k4
9 integer(kind
=8), kind
:: k8
10 integer(kind
=k1
) :: j1
11 integer(kind
=k2
) :: j2
12 integer(kind
=k4
) :: j4
13 integer(kind
=k8
) :: j8
15 type :: defaulted(n1
,n2
,n4
,n8
)
16 integer(kind
=1), kind
:: n1
= 1
17 integer(kind
=2), kind
:: n2
= n1
* 2
18 integer(kind
=4), kind
:: n4
= 2 * n2
19 integer(kind
=8), kind
:: n8
= 12 - n4
20 type(capture(n1
,n2
,n4
,n8
)) :: cap
22 type, extends(defaulted
) :: extension(k5
)
23 integer(kind
=4), kind
:: k5
= 4
24 integer(kind
=k5
) :: j5
26 type(capture(1,1,1,1)) :: x1111
27 integer(kind
=x1111
%j1
%kind
) :: res01_1
28 integer(kind
=x1111
%j2
%kind
) :: res02_1
29 integer(kind
=x1111
%j4
%kind
) :: res03_1
30 integer(kind
=x1111
%j8
%kind
) :: res04_1
31 type(capture(8,8,8,8)) :: x8888
32 integer(kind
=x8888
%j1
%kind
) :: res05_8
33 integer(kind
=x8888
%j2
%kind
) :: res06_8
34 integer(kind
=x8888
%j4
%kind
) :: res07_8
35 integer(kind
=x8888
%j8
%kind
) :: res08_8
36 type(capture(2,k8
=1,k4
=8,k2
=4)) :: x2481
37 integer(kind
=x2481
%j1
%kind
) :: res09_2
38 integer(kind
=x2481
%j2
%kind
) :: res10_4
39 integer(kind
=x2481
%j4
%kind
) :: res11_8
40 integer(kind
=x2481
%j8
%kind
) :: res12_1
41 type(capture(2,1,k4
=8,k8
=4)) :: x2184
42 integer(kind
=x2184
%j1
%kind
) :: res13_2
43 integer(kind
=x2184
%j2
%kind
) :: res14_1
44 integer(kind
=x2184
%j4
%kind
) :: res15_8
45 integer(kind
=x2184
%j8
%kind
) :: res16_4
46 type(defaulted
) :: x1248
47 integer(kind
=x1248
%cap
%j1
%kind
) :: res17_1
48 integer(kind
=x1248
%cap
%j2
%kind
) :: res18_2
49 integer(kind
=x1248
%cap
%j4
%kind
) :: res19_4
50 integer(kind
=x1248
%cap
%j8
%kind
) :: res20_8
51 type(defaulted(2)) :: x2484
52 integer(kind
=x2484
%cap
%j1
%kind
) :: res21_2
53 integer(kind
=x2484
%cap
%j2
%kind
) :: res22_4
54 integer(kind
=x2484
%cap
%j4
%kind
) :: res23_8
55 integer(kind
=x2484
%cap
%j8
%kind
) :: res24_4
56 type(defaulted(n8
=2)) :: x1242
57 integer(kind
=x1242
%cap
%j1
%kind
) :: res25_1
58 integer(kind
=x1242
%cap
%j2
%kind
) :: res26_2
59 integer(kind
=x1242
%cap
%j4
%kind
) :: res27_4
60 integer(kind
=x1242
%cap
%j8
%kind
) :: res28_2
61 type(extension(1,1,1,1,1)) :: x11111
62 integer(kind
=x11111
%defaulted
%cap
%j1
%kind
) :: res29_1
63 integer(kind
=x11111
%cap
%j2
%kind
) :: res30_1
64 integer(kind
=x11111
%cap
%j4
%kind
) :: res31_1
65 integer(kind
=x11111
%cap
%j8
%kind
) :: res32_1
66 integer(kind
=x11111
%j5
%kind
) :: res33_1
67 type(extension(2,8,4,1,8)) :: x28418
68 integer(kind
=x28418
%defaulted
%cap
%j1
%kind
) :: res34_2
69 integer(kind
=x28418
%cap
%j2
%kind
) :: res35_8
70 integer(kind
=x28418
%cap
%j4
%kind
) :: res36_4
71 integer(kind
=x28418
%cap
%j8
%kind
) :: res37_1
72 integer(kind
=x28418
%j5
%kind
) :: res38_8
73 type(extension(8,n8
=1,k5
=2,n2
=4,n4
=8)) :: x84812
74 integer(kind
=x84812
%defaulted
%cap
%j1
%kind
) :: res39_8
75 integer(kind
=x84812
%cap
%j2
%kind
) :: res40_4
76 integer(kind
=x84812
%cap
%j4
%kind
) :: res41_8
77 integer(kind
=x84812
%cap
%j8
%kind
) :: res42_1
78 integer(kind
=x84812
%j5
%kind
) :: res43_2
79 type(extension(k5
=2)) :: x12482
80 integer(kind
=x12482
%defaulted
%cap
%j1
%kind
) :: res44_1
81 integer(kind
=x12482
%cap
%j2
%kind
) :: res45_2
82 integer(kind
=x12482
%cap
%j4
%kind
) :: res46_4
83 integer(kind
=x12482
%cap
%j8
%kind
) :: res47_8
84 integer(kind
=x12482
%j5
%kind
) :: res48_2
89 !type::capture(k1,k2,k4,k8)
94 !integer(int(int(k1,kind=1),kind=8))::j1
95 !integer(int(int(k2,kind=2),kind=8))::j2
96 !integer(int(int(k4,kind=4),kind=8))::j4
99 !type::defaulted(n1,n2,n4,n8)
100 !integer(1),kind::n1=1_1
101 !integer(2),kind::n2=int(2_4*int(int(n1,kind=1),kind=4),kind=2)
102 !integer(4),kind::n4=2_4*int(int(n2,kind=2),kind=4)
103 !integer(8),kind::n8=int(12_4-int(n4,kind=4),kind=8)
104 !type(capture(k1=int(n1,kind=1),k2=int(n2,kind=2),k4=int(n4,kind=4),k8=n8))::cap
106 !type,extends(defaulted)::extension(k5)
107 !integer(4),kind::k5=4_4
108 !integer(int(int(k5,kind=4),kind=8))::j5
110 !type(capture(k1=1_1,k2=1_2,k4=1_4,k8=1_8))::x1111
115 !type(capture(k1=8_1,k2=8_2,k4=8_4,k8=8_8))::x8888
120 !type(capture(k1=2_1,k2=4_2,k4=8_4,k8=1_8))::x2481
125 !type(capture(k1=2_1,k2=1_2,k4=8_4,k8=4_8))::x2184
130 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x1248
135 !type(defaulted(n1=2_1,n2=4_2,n4=8_4,n8=4_8))::x2484
140 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=2_8))::x1242
145 !type(extension(k5=1_4,n1=1_1,n2=1_2,n4=1_4,n8=1_8))::x11111
151 !type(extension(k5=8_4,n1=2_1,n2=8_2,n4=4_4,n8=1_8))::x28418
157 !type(extension(k5=2_4,n1=8_1,n2=4_2,n4=8_4,n8=1_8))::x84812
163 !type(extension(k5=2_4,n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x12482