ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_22.f90
blob50378865a641ade7822f83d77aa5ad4714de0e9c
1 ! { dg-do run }
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>
8 program p
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
14 z = c
15 if (any (z .ne. ['a', 'b', 'c'])) stop 2
16 z = c(2:1:-1)
17 if (any (z .ne. ['b', 'a'])) stop 3
18 z = c(3)
19 if (any (z .ne. ['c', 'c'])) stop 4
20 z = a([3,1,2])
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
26 deallocate (z)
27 end