aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/associate_34.f90
blob: 925dee9ff741dc98968d0474a8f71c748e628ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do run }
!
! Test the fix for PR84115.
!
! Contributed by G Steinmetz  <gscfq@t-online.de>
!
  character(:), allocatable :: chr
  allocate (chr, source = "abc")
  call s(chr, "abc")
  chr = "mary had a little lamb"
  call s(chr, "mary had a little lamb")
  deallocate (chr)
contains
  subroutine s(x, carg)
    character(:), allocatable :: x
    character(*) :: carg
    associate (y => x)
      if (y .ne. carg) STOP 1
    end associate
  end
end