2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr65504.f90
blob3860422b3225a264382218c5a56a792e43b690bf
1 ! PR target/65504
2 ! { dg-do run }
4 program pr65504
5 implicit none
6 type :: T
7 character (len=256) :: a
8 character (len=256) :: b
9 end type T
10 type (T) :: c
11 type (T) :: d
12 c = foo ("test")
13 d = foo ("test")
14 if (trim(c%b) .ne. "foo") call abort
15 contains
16 type (T) function foo (x) result (v)
17 character(len=*), intent(in) :: x
18 select case (x)
19 case ("test")
20 v%b = 'foo'
21 case ("bazx")
22 v%b = 'barx'
23 case default
24 print *, "unknown"
25 stop
26 end select
27 end function foo
28 end program pr65504