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