re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_35.f90
blob67329785bc4315fe086f05a4e2163f4fa912687f
1 ! { dg-do run }
3 ! Test the fix for PR84115 comment #1.
5 ! Contributed by G Steinmetz <gscfq@t-online.de>
7 character(:), allocatable :: dum
8 dum = "s1"
9 call s1 (dum)
10 dum = "s2"
11 call s2 (dum)
12 dum = "s3"
13 call s3 (dum)
14 contains
15 subroutine s1(x)
16 character(:), allocatable :: x
17 associate (y => x//x)
18 if (y .ne. x//x) stop 1
19 end associate
20 end
22 subroutine s2(x)
23 character(:), allocatable :: x
24 associate (y => [x])
25 if (any(y .ne. [x])) stop 2
26 end associate
27 end
29 subroutine s3(x)
30 character(:), allocatable :: x
31 associate (y => [x,x])
32 if (any(y .ne. [x,x])) stop 3
33 end associate
34 end
35 end