[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_34.f90
blob629c0b43611006010a4980ec665eb4e9870b6db5
1 ! { dg-do run }
3 ! Test the fix for PR84115.
5 ! Contributed by G Steinmetz <gscfq@t-online.de>
7 character(:), allocatable :: chr
8 allocate (chr, source = "abc")
9 call s(chr, "abc")
10 chr = "mary had a little lamb"
11 call s(chr, "mary had a little lamb")
12 deallocate (chr)
13 contains
14 subroutine s(x, carg)
15 character(:), allocatable :: x
16 character(*) :: carg
17 associate (y => x)
18 if (y .ne. carg) call abort
19 end associate
20 end
21 end