2 ! Test the fix for PR31197 and PR31258 in which the substrings below
3 ! would cause ICEs because the character lengths were never resolved.
5 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
6 ! and Thomas Koenig <tkoenig@gcc.gnu.org>
8 CHARACTER(LEN
=3), DIMENSION(10) :: Z
9 CHARACTER(LEN
=3), DIMENSION(3,3) :: W
19 if (ctr
.ne
. 8) call abort
21 subroutine test_reshape
23 if (any (RESHAPE(Z(:)(2:2),(/5,2/)) .ne
. "2")) call abort
26 subroutine test_eoshift
27 CHARACTER(LEN
=1), DIMENSION(10) :: chk
31 if (any (EOSHIFT(Z(:)(2:2),2) .ne
. chk
)) call abort
34 subroutine test_cshift
36 if (any (CSHIFT(Z(:)(2:2),2) .ne
. "0")) call abort
39 subroutine test_spread
41 if (any (SPREAD(Z(:)(2:2),dim
=1,ncopies
=2) .ne
. "8")) call abort
44 subroutine test_transpose
46 if (any (TRANSPOSE(W(:,:)(1:2)) .ne
. "ab")) call abort
51 if (any (pack(W(:,:)(2:3),mask
=.true
.) .ne
. "ef")) call abort
54 subroutine test_unpack
55 logical, dimension(5,2) :: mask
58 if (any (unpack(Z(:)(2:2),mask
,' ') .ne
. "i")) call abort
61 subroutine test_pr31197
63 CHARACTER(LEN
=3) :: A
= "xyz"
65 TYPE(data), DIMENSION(10), TARGET
:: T
66 if (any (TRANSPOSE(RESHAPE(T(:)%A(2:2),(/5,2/))) .ne
. "y")) call abort