annotate gcc/testsuite/gfortran.dg/allocate_with_source_3.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! Contributed by Reinhold Bader
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 program assumed_shape_01
kono
parents:
diff changeset
6 use, intrinsic :: iso_c_binding
kono
parents:
diff changeset
7 implicit none
kono
parents:
diff changeset
8 type, bind(c) :: cstruct
kono
parents:
diff changeset
9 integer(c_int) :: i
kono
parents:
diff changeset
10 real(c_float) :: r(2)
kono
parents:
diff changeset
11 end type cstruct
kono
parents:
diff changeset
12 interface
kono
parents:
diff changeset
13 subroutine psub(this, that) bind(c, name='Psub')
kono
parents:
diff changeset
14 import :: c_float, cstruct
kono
parents:
diff changeset
15 real(c_float) :: this(:,:)
kono
parents:
diff changeset
16 type(cstruct) :: that(:)
kono
parents:
diff changeset
17 end subroutine psub
kono
parents:
diff changeset
18 end interface
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 real(c_float) :: t(3,7)
kono
parents:
diff changeset
21 type(cstruct), pointer :: u(:)
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 ! The following is VALID Fortran 2008 but NOT YET supported
kono
parents:
diff changeset
24 allocate(u, source=[cstruct( 4, [1.1,2.2] ) ])
kono
parents:
diff changeset
25 call psub(t, u)
kono
parents:
diff changeset
26 deallocate (u)
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 end program assumed_shape_01