1 ! RUN: %S/test_modfile.sh %s %t %flang_fc1
3 ! Tests parameterized derived type instantiation with KIND parameters
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
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
23 type, extends(defaulted
) :: extension(k5
)
24 integer(kind
=4), kind
:: k5
= 4
25 integer(kind
=k5
) :: j5
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
90 !type::capture(k1,k2,k4,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
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
107 !type,extends(defaulted)::extension(k5)
108 !integer(4),kind::k5=4_4
109 !integer(int(int(k5,kind=4),kind=8))::j5
111 !type(capture(k1=1_1,k2=1_2,k4=1_4,k8=1_8))::x1111
116 !type(capture(k1=8_1,k2=8_2,k4=8_4,k8=8_8))::x8888
121 !type(capture(k1=2_1,k2=4_2,k4=8_4,k8=1_8))::x2481
126 !type(capture(k1=2_1,k2=1_2,k4=8_4,k8=4_8))::x2184
131 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x1248
136 !type(defaulted(n1=2_1,n2=4_2,n4=8_4,n8=4_8))::x2484
141 !type(defaulted(n1=1_1,n2=2_2,n4=4_4,n8=2_8))::x1242
146 !type(extension(k5=1_4,n1=1_1,n2=1_2,n4=1_4,n8=1_8))::x11111
152 !type(extension(k5=8_4,n1=2_1,n2=8_2,n4=4_4,n8=1_8))::x28418
158 !type(extension(k5=2_4,n1=8_1,n2=4_2,n4=8_4,n8=1_8))::x84812
164 !type(extension(k5=2_4,n1=1_1,n2=2_2,n4=4_4,n8=8_8))::x12482