Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / iolength_2.f90
blobac65778639e2835242fb11f3e2f2b19484a225ca
1 ! Test that IOLENGTH works for derived types containing arrays
2 module iolength_2_mod
3 integer, parameter :: &
4 ! 32 bit, i.e. 4 byte integer (every gcc architecture should have this?)
5 int32 = selected_int_kind(9), &
6 ! IEEE double precision, i.e. 8 bytes
7 dp = selected_real_kind(15, 307)
8 type foo
9 ! This type should take up 5*4+4+8=32 bytes
10 integer(int32) :: a(5), b
11 real(dp) :: c
12 end type foo
13 end module iolength_2_mod
15 program iolength_2
16 use iolength_2_mod
17 implicit none
18 integer :: iol
19 type(foo) :: d
20 inquire (iolength = iol) d
21 if ( 32 /= iol) then
22 call abort
23 end if
24 end program iolength_2