hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_with_source_3.f90
blob93f6edb06d1b463aae5ab9f8ed0415882a7c10d2
1 ! { dg-do compile }
3 ! Contributed by Reinhold Bader
5 program assumed_shape_01
6 use, intrinsic :: iso_c_binding
7 implicit none
8 type, bind(c) :: cstruct
9 integer(c_int) :: i
10 real(c_float) :: r(2)
11 end type cstruct
12 interface
13 subroutine psub(this, that) bind(c, name='Psub')
14 import :: c_float, cstruct
15 real(c_float) :: this(:,:)
16 type(cstruct) :: that(:)
17 end subroutine psub
18 end interface
20 real(c_float) :: t(3,7)
21 type(cstruct), pointer :: u(:)
23 ! The following is VALID Fortran 2008 but NOT YET supported
24 allocate(u, source=[cstruct( 4, [1.1,2.2] ) ])
25 call psub(t, u)
26 deallocate (u)
28 end program assumed_shape_01