2015-02-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / type_to_class_2.f03
blob82f98cc3f4a988824b1dda9eebef18b4dc772091
1 ! { dg-do run }
3 ! Test the fix for PR64757.
5 ! Contributed by Michael Lee Rilee  <mike@rilee.net>
7   type :: Test
8     integer :: i
9   end type
11   type :: TestReference
12      class(Test), allocatable :: test
13   end type
15   type(TestReference) :: testList
16   type(test) :: x
18   testList = TestReference(Test(99))  ! ICE in fold_convert_loc was here
20   x = testList%test
22   select type (y => testList%test)    ! Check vptr set
23     type is (Test)
24       if (x%i .ne. y%i) call abort
25     class default
26       call abort
27   end select
28 end