summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/select_type_39.f03
blob: c0ff3a209f142e4c6526d8ca2652124abe81822c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
!
! Tests the fix for PR67564 comment #9.
!
! Contributed by Neil Carlson  <neil.n.carlson@gmail.com>
!
class(*), allocatable :: val(:)
call get_value (val)
select type (val)
type is (character(*))
  if (size (val) .ne. 2) STOP 1
  if (len(val) .ne. 3) STOP 2
  if (any (val .ne. ['foo','bar'])) STOP 3
end select
contains
  subroutine get_value (value)
    class(*), allocatable, intent(out) :: value(:)
    allocate(value, source=['foo','bar'])
  end subroutine
end