PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_result_6.f90
blob9daabb0a0d6b479926b8118ad1936055afeb0abd
1 ! { dg-do run }
3 ! Test the fix for PR79072 comment #12. A description of the problem
4 ! is to be found in class_result_5.f90.
6 ! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
8 character(3), target :: a = 'foo'
9 class(*), pointer :: b
10 b => ptr()
11 select type (b)
12 type is (character(*))
13 if (a .ne. "bar") STOP 1
14 end select
15 contains
16 function ptr()
17 class(*), pointer :: ptr
18 ptr => a
19 select type (ptr)
20 type is (character(*))
21 ptr = "bar"
22 end select
23 end function
24 end