aarch64: Add missing ACLE macro for NEON-SVE Bridge
[official-gcc.git] / gcc / testsuite / gfortran.dg / type_to_class_3.f03
blob715312e6bfcd01936ea1e1032b468b55e88e3773
1 ! { dg-do run }
3 ! Test the fix for the array version of PR64757.
5 ! Based on 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), allocatable :: x(:)
18   testList = TestReference([Test(99), Test(199)])  ! Gave: The rank of the element in the
19                                                    ! structure constructor at (1) does not
20                                                    ! match that of the component (1/0)
21 ! allocate (testList%test(2), source = [Test(99), Test(199)]) ! Works, of course
23   x = testList%test
25   select type (y => testList%test)    ! Check vptr set
26     type is (Test)
27       if (any(x%i .ne. y%i)) STOP 1
28     class default
29       STOP 2
30   end select
31 end