re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / storage_size_1.f08
blobc444dac4cdf0577f006a5aa82c13504f890c3e59
1 ! { dg-do run }
3 ! PR 44649: [OOP] F2008: storage_size intrinsic
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 type :: t
8   integer(4) :: i
9   real(4) :: r
10 end type
12 type,extends(t) :: t2
13   integer(4) :: j
14 end type
16 type(t) :: a
17 type(t), dimension(1:3) :: b
18 class(t), allocatable :: cp
20 allocate(t2::cp)
22 if (sizeof(a)        /=  8) STOP 1
23 if (storage_size(a)  /= 64) STOP 2
25 if (sizeof(b)        /= 24) STOP 3
26 if (storage_size(b)  /= 64) STOP 4
28 if (sizeof(cp)       /= 12) STOP 5
29 if (storage_size(cp) /= 96) STOP 6
31 end