1 |
694 |
jeremybenn |
! { dg-do run }
|
2 |
|
|
program foo
|
3 |
|
|
implicit none
|
4 |
|
|
integer(kind=1), dimension (10) :: i_1
|
5 |
|
|
integer(kind=1), dimension (2, 3) :: a_1
|
6 |
|
|
integer(kind=1), dimension (2, 2, 3) :: b_1
|
7 |
|
|
integer(kind=2), dimension (10) :: i_2
|
8 |
|
|
integer(kind=2), dimension (2, 3) :: a_2
|
9 |
|
|
integer(kind=2), dimension (2, 2, 3) :: b_2
|
10 |
|
|
integer(kind=4), dimension (10) :: i_4
|
11 |
|
|
integer(kind=4), dimension (2, 3) :: a_4
|
12 |
|
|
integer(kind=4), dimension (2, 2, 3) :: b_4
|
13 |
|
|
integer(kind=8), dimension (10) :: i_8
|
14 |
|
|
integer(kind=8), dimension (2, 3) :: a_8
|
15 |
|
|
integer(kind=8), dimension (2, 2, 3) :: b_8
|
16 |
|
|
real(kind=4), dimension (10) :: r_4
|
17 |
|
|
real(kind=4), dimension (2, 3) :: ar_4
|
18 |
|
|
real(kind=4), dimension (2, 2, 3) :: br_4
|
19 |
|
|
real(kind=8), dimension (10) :: r_8
|
20 |
|
|
real(kind=8), dimension (2, 3) :: ar_8
|
21 |
|
|
real(kind=8), dimension (2, 2, 3) :: br_8
|
22 |
|
|
complex(kind=4), dimension (10) :: c_4
|
23 |
|
|
complex(kind=4), dimension (2, 3) :: ac_4
|
24 |
|
|
complex(kind=4), dimension (2, 2, 3) :: bc_4
|
25 |
|
|
complex(kind=8), dimension (10) :: c_8
|
26 |
|
|
complex(kind=8), dimension (2, 3) :: ac_8
|
27 |
|
|
complex(kind=8), dimension (2, 2, 3) :: bc_8
|
28 |
|
|
type i4_t
|
29 |
|
|
integer(kind=4) :: v
|
30 |
|
|
end type i4_t
|
31 |
|
|
type(i4_t), dimension (10) :: it_4
|
32 |
|
|
type(i4_t), dimension (2, 3) :: at_4
|
33 |
|
|
type(i4_t), dimension (2, 2, 3) :: bt_4
|
34 |
|
|
type(i4_t) :: iv_4
|
35 |
|
|
|
36 |
|
|
character (len=200) line1, line2, line3
|
37 |
|
|
|
38 |
|
|
a_1 = reshape ((/1_1, 2_1, 3_1, 4_1, 5_1, 6_1/), (/2, 3/))
|
39 |
|
|
b_1 = spread (a_1, 1, 2)
|
40 |
|
|
if (any (b_1 .ne. reshape ((/1_1, 1_1, 2_1, 2_1, 3_1, 3_1, 4_1, 4_1, 5_1, 5_1, 6_1, 6_1/), &
|
41 |
|
|
(/2, 2, 3/)))) &
|
42 |
|
|
call abort
|
43 |
|
|
line1 = ' '
|
44 |
|
|
write(line1, 9000) b_1
|
45 |
|
|
line2 = ' '
|
46 |
|
|
write(line2, 9000) spread (a_1, 1, 2)
|
47 |
|
|
if (line1 /= line2) call abort
|
48 |
|
|
line3 = ' '
|
49 |
|
|
write(line3, 9000) spread (a_1, 1, 2) + 0_1
|
50 |
|
|
if (line1 /= line3) call abort
|
51 |
|
|
i_1 = spread(1_1,1,10)
|
52 |
|
|
if (any(i_1 /= 1_1)) call abort
|
53 |
|
|
|
54 |
|
|
a_2 = reshape ((/1_2, 2_2, 3_2, 4_2, 5_2, 6_2/), (/2, 3/))
|
55 |
|
|
b_2 = spread (a_2, 1, 2)
|
56 |
|
|
if (any (b_2 .ne. reshape ((/1_2, 1_2, 2_2, 2_2, 3_2, 3_2, 4_2, 4_2, 5_2, 5_2, 6_2, 6_2/), &
|
57 |
|
|
(/2, 2, 3/)))) &
|
58 |
|
|
call abort
|
59 |
|
|
line1 = ' '
|
60 |
|
|
write(line1, 9000) b_2
|
61 |
|
|
line2 = ' '
|
62 |
|
|
write(line2, 9000) spread (a_2, 1, 2)
|
63 |
|
|
if (line1 /= line2) call abort
|
64 |
|
|
line3 = ' '
|
65 |
|
|
write(line3, 9000) spread (a_2, 1, 2) + 0_2
|
66 |
|
|
if (line1 /= line3) call abort
|
67 |
|
|
i_2 = spread(1_2,1,10)
|
68 |
|
|
if (any(i_2 /= 1_2)) call abort
|
69 |
|
|
|
70 |
|
|
a_4 = reshape ((/1_4, 2_4, 3_4, 4_4, 5_4, 6_4/), (/2, 3/))
|
71 |
|
|
b_4 = spread (a_4, 1, 2)
|
72 |
|
|
if (any (b_4 .ne. reshape ((/1_4, 1_4, 2_4, 2_4, 3_4, 3_4, 4_4, 4_4, 5_4, 5_4, 6_4, 6_4/), &
|
73 |
|
|
(/2, 2, 3/)))) &
|
74 |
|
|
call abort
|
75 |
|
|
line1 = ' '
|
76 |
|
|
write(line1, 9000) b_4
|
77 |
|
|
line2 = ' '
|
78 |
|
|
write(line2, 9000) spread (a_4, 1, 2)
|
79 |
|
|
if (line1 /= line2) call abort
|
80 |
|
|
line3 = ' '
|
81 |
|
|
write(line3, 9000) spread (a_4, 1, 2) + 0_4
|
82 |
|
|
if (line1 /= line3) call abort
|
83 |
|
|
i_4 = spread(1_4,1,10)
|
84 |
|
|
if (any(i_4 /= 1_4)) call abort
|
85 |
|
|
|
86 |
|
|
a_8 = reshape ((/1_8, 2_8, 3_8, 4_8, 5_8, 6_8/), (/2, 3/))
|
87 |
|
|
b_8 = spread (a_8, 1, 2)
|
88 |
|
|
if (any (b_8 .ne. reshape ((/1_8, 1_8, 2_8, 2_8, 3_8, 3_8, 4_8, 4_8, 5_8, 5_8, 6_8, 6_8/), &
|
89 |
|
|
(/2, 2, 3/)))) &
|
90 |
|
|
call abort
|
91 |
|
|
line1 = ' '
|
92 |
|
|
write(line1, 9000) b_8
|
93 |
|
|
line2 = ' '
|
94 |
|
|
write(line2, 9000) spread (a_8, 1, 2)
|
95 |
|
|
if (line1 /= line2) call abort
|
96 |
|
|
line3 = ' '
|
97 |
|
|
write(line3, 9000) spread (a_8, 1, 2) + 0_8
|
98 |
|
|
if (line1 /= line3) call abort
|
99 |
|
|
i_8 = spread(1_8,1,10)
|
100 |
|
|
if (any(i_8 /= 1_8)) call abort
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
ar_4 = reshape ((/1._4, 2._4, 3._4, 4._4, 5._4, 6._4/), (/2, 3/))
|
104 |
|
|
br_4 = spread (ar_4, 1, 2)
|
105 |
|
|
if (any (br_4 .ne. reshape ((/1._4, 1._4, 2._4, 2._4, 3._4, 3._4, &
|
106 |
|
|
& 4._4, 4._4, 5._4, 5._4, 6._4, 6._4/), (/2, 2, 3/)))) call abort
|
107 |
|
|
line1 = ' '
|
108 |
|
|
write(line1, 9010) br_4
|
109 |
|
|
line2 = ' '
|
110 |
|
|
write(line2, 9010) spread (ar_4, 1, 2)
|
111 |
|
|
if (line1 /= line2) call abort
|
112 |
|
|
line3 = ' '
|
113 |
|
|
write(line3, 9010) spread (ar_4, 1, 2) + 0._4
|
114 |
|
|
if (line1 /= line3) call abort
|
115 |
|
|
r_4 = spread(1._4,1,10)
|
116 |
|
|
if (any(r_4 /= 1._4)) call abort
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
ar_8 = reshape ((/1._8, 2._8, 3._8, 4._8, 5._8, 6._8/), (/2, 3/))
|
120 |
|
|
br_8 = spread (ar_8, 1, 2)
|
121 |
|
|
if (any (br_8 .ne. reshape ((/1._8, 1._8, 2._8, 2._8, 3._8, 3._8, &
|
122 |
|
|
& 4._8, 4._8, 5._8, 5._8, 6._8, 6._8/), (/2, 2, 3/)))) call abort
|
123 |
|
|
line1 = ' '
|
124 |
|
|
write(line1, 9010) br_8
|
125 |
|
|
line2 = ' '
|
126 |
|
|
write(line2, 9010) spread (ar_8, 1, 2)
|
127 |
|
|
if (line1 /= line2) call abort
|
128 |
|
|
line3 = ' '
|
129 |
|
|
write(line3, 9010) spread (ar_8, 1, 2) + 0._8
|
130 |
|
|
if (line1 /= line3) call abort
|
131 |
|
|
r_8 = spread(1._8,1,10)
|
132 |
|
|
if (any(r_8 /= 1._8)) call abort
|
133 |
|
|
|
134 |
|
|
ac_4 = reshape ((/(1._4,-1._4), (2._4,-2._4), (3._4, -3._4), (4._4, -4._4), &
|
135 |
|
|
& (5._4,-5._4), (6._4,-6._4)/), (/2, 3/))
|
136 |
|
|
bc_4 = spread (ac_4, 1, 2)
|
137 |
|
|
if (any (real(bc_4) .ne. reshape ((/1._4, 1._4, 2._4, 2._4, 3._4, 3._4, &
|
138 |
|
|
& 4._4, 4._4, 5._4, 5._4, 6._4, 6._4/), (/2, 2, 3/)))) call abort
|
139 |
|
|
if (any (-aimag(bc_4) .ne. reshape ((/1._4, 1._4, 2._4, 2._4, 3._4, 3._4, &
|
140 |
|
|
& 4._4, 4._4, 5._4, 5._4, 6._4, 6._4/), (/2, 2, 3/)))) call abort
|
141 |
|
|
line1 = ' '
|
142 |
|
|
write(line1, 9020) bc_4
|
143 |
|
|
line2 = ' '
|
144 |
|
|
write(line2, 9020) spread (ac_4, 1, 2)
|
145 |
|
|
if (line1 /= line2) call abort
|
146 |
|
|
line3 = ' '
|
147 |
|
|
write(line3, 9020) spread (ac_4, 1, 2) + 0._4
|
148 |
|
|
if (line1 /= line3) call abort
|
149 |
|
|
c_4 = spread((1._4,-1._4),1,10)
|
150 |
|
|
if (any(c_4 /= (1._4,-1._4))) call abort
|
151 |
|
|
|
152 |
|
|
ac_8 = reshape ((/(1._8,-1._8), (2._8,-2._8), (3._8, -3._8), (4._8, -4._8), &
|
153 |
|
|
& (5._8,-5._8), (6._8,-6._8)/), (/2, 3/))
|
154 |
|
|
bc_8 = spread (ac_8, 1, 2)
|
155 |
|
|
if (any (real(bc_8) .ne. reshape ((/1._8, 1._8, 2._8, 2._8, 3._8, 3._8, &
|
156 |
|
|
& 4._8, 4._8, 5._8, 5._8, 6._8, 6._8/), (/2, 2, 3/)))) call abort
|
157 |
|
|
if (any (-aimag(bc_8) .ne. reshape ((/1._8, 1._8, 2._8, 2._8, 3._8, 3._8, &
|
158 |
|
|
& 4._8, 4._8, 5._8, 5._8, 6._8, 6._8/), (/2, 2, 3/)))) call abort
|
159 |
|
|
line1 = ' '
|
160 |
|
|
write(line1, 9020) bc_8
|
161 |
|
|
line2 = ' '
|
162 |
|
|
write(line2, 9020) spread (ac_8, 1, 2)
|
163 |
|
|
if (line1 /= line2) call abort
|
164 |
|
|
line3 = ' '
|
165 |
|
|
write(line3, 9020) spread (ac_8, 1, 2) + 0._8
|
166 |
|
|
if (line1 /= line3) call abort
|
167 |
|
|
c_8 = spread((1._8,-1._8),1,10)
|
168 |
|
|
if (any(c_8 /= (1._8,-1._8))) call abort
|
169 |
|
|
|
170 |
|
|
|
171 |
|
|
at_4%v = reshape ((/1_4, 2_4, 3_4, 4_4, 5_4, 6_4/), (/2, 3/))
|
172 |
|
|
bt_4 = spread (at_4, 1, 2)
|
173 |
|
|
if (any (bt_4%v .ne. reshape ((/1_4, 1_4, 2_4, 2_4, 3_4, 3_4, 4_4, &
|
174 |
|
|
& 4_4, 5_4, 5_4, 6_4, 6_4/), (/2, 2, 3/)))) &
|
175 |
|
|
call abort
|
176 |
|
|
iv_4%v = 123_4
|
177 |
|
|
it_4 = spread(iv_4,1,10)
|
178 |
|
|
if (any(it_4%v /= 123_4)) call abort
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
9000 format(12I3)
|
182 |
|
|
9010 format(12F7.3)
|
183 |
|
|
9020 format(25F7.3)
|
184 |
|
|
|
185 |
|
|
end program
|