view gcc/testsuite/gfortran.dg/type_to_class_2.f03 @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do run }
!
! Test the fix for PR64757.
!
! Contributed by Michael Lee Rilee  <mike@rilee.net>
!
  type :: Test
    integer :: i
  end type

  type :: TestReference
     class(Test), allocatable :: test
  end type

  type(TestReference) :: testList
  type(test) :: x

  testList = TestReference(Test(99))  ! ICE in fold_convert_loc was here

  x = testList%test

  select type (y => testList%test)    ! Check vptr set
    type is (Test)
      if (x%i .ne. y%i) call abort
    class default
      call abort
  end select
end