2 ! This tests a few reshape PRs.
5 real, dimension (2,3) :: a
,c
6 real, dimension (12) :: b
10 type(foo
), dimension (2,3) :: ar
11 type(foo
), dimension (12) :: br
13 character (len
=80) line1
, line2
, line3
16 ! PR 21108: This used to give undefined results.
18 a
= reshape(b(1:12:2),shape(a
),order
=(/2,1/))
19 c
= reshape(b(1:12:2),shape(a
),order
=(/2,1/))
20 if (any (a
/= c
)) STOP 1
22 ! Test generic reshape
24 ar
= reshape(br(1:12:2),shape(a
),order
=(/2,1/))
25 if (any (ar
%r
/= a
)) STOP 2
27 ! Test callee-allocated memory with a write statement
28 write (line1
,'(6F8.3)') reshape(b(1:12:2),shape(a
),order
=(/2,1/))
29 write (line2
,'(6F8.3)') a
30 if (line1
/= line2
) STOP 3
31 write (line3
,'(6F8.3)') reshape(br(1:12:2),shape(ar
),order
=(/2,1/))
32 if (line1
/= line3
) STOP 4