summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr65504.f90
blob: 6c2422abca7965828c1da3c025043a8802cc6de2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! PR target/65504
! { dg-do run }

program pr65504
  implicit none
  type :: T
    character (len=256) :: a
    character (len=256) :: b
  end type T
  type (T) :: c
  type (T) :: d
  c = foo ("test")
  d = foo ("test")
  if (trim(c%b) .ne. "foo") STOP 1
  contains
  type (T) function foo (x) result (v)
    character(len=*), intent(in) :: x
    select case (x)
    case ("test")
      v%b = 'foo'
    case ("bazx")
      v%b = 'barx'
    case default
      print *, "unknown"
      stop
    end select
  end function foo
end program pr65504