view gcc/testsuite/gfortran.dg/pr65504.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! 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") call abort
  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