1! { dg-do run }
2!
3! Test the fix for PR64757.
4!
5! Contributed by Michael Lee Rilee  <mike@rilee.net>
6!
7  type :: Test
8    integer :: i
9  end type
10
11  type :: TestReference
12     class(Test), allocatable :: test
13  end type
14
15  type(TestReference) :: testList
16  type(test) :: x
17
18  testList = TestReference(Test(99))  ! ICE in fold_convert_loc was here
19
20  x = testList%test
21
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
28end
29
30
31