3 ! Test the fix for PR77325, which casued an ICE in the gimplifier. The
4 ! segafults in 'contains_struct_check' were found while diagnosing the PR.
6 ! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
9 character(3), parameter :: a(3) = ['abc', 'def', 'ghi']
10 character(1), parameter :: c(3) = ['a', 'b', 'c']
11 character(:), allocatable
:: z(:)
12 z
= c([3,2]) ! Vector subscripts caused an iCE in the gimplifier.
13 if (any (z
.ne
. ['c', 'b'])) stop 1
15 if (any (z
.ne
. ['a', 'b', 'c'])) stop 2
17 if (any (z
.ne
. ['b', 'a'])) stop 3
19 if (any (z
.ne
. ['c', 'c'])) stop 4
21 if (any (z
.ne
. ['ghi', 'abc', 'def'])) stop 5
22 z
= a(1:2)(2:3) ! Substrings caused a segfault in 'contains_struct_check'.
23 if (any (z
.ne
. ['bc', 'ef'])) stop 6
24 z
= a([2,3,1])(2:3) ! ditto
25 if (any (z
.ne
. ['ef', 'hi', 'bc'])) stop 7