Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / PR100245.f90
blob07c1f7b3a1ce011df977e900a8f571109b46afc5
1 ! { dg-do run }
3 ! Test the fix for PR100245
6 program main_p
8 implicit none
10 type :: foo_t
11 integer :: a
12 end type foo_t
14 integer, parameter :: a = 42
16 class(foo_t), allocatable :: val
17 class(foo_t), allocatable :: rs1
18 type(foo_t), allocatable :: rs2
20 allocate(val, source=foo_t(42))
21 if (val%a/=a) stop 1
22 rs1 = val
23 if (rs1%a/=a) stop 2
24 rs2 = val
25 if (rs2%a/=a) stop 3
26 deallocate(val, rs1, rs2)
28 end program main_p