OSDN Git Service

2008-03-04 Uros Bizjak <ubizjak@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / common_10.f90
1 use iso_c_binding
2 implicit none
3
4 type, bind(C) :: mytype1
5   integer(c_int) :: x
6   real(c_float)    :: y
7 end type mytype1
8
9 type mytype2
10   sequence
11   integer :: x
12   real    :: y
13 end type mytype2
14
15 type mytype3
16   integer :: x
17   real    :: y
18 end type mytype3
19
20 type mytype4
21   sequence
22   integer, allocatable, dimension(:) :: x
23 end type mytype4
24
25 type mytype5
26   sequence
27   integer, pointer :: x
28   integer :: y
29 end type mytype5
30
31 type mytype6
32   sequence
33   type(mytype5) :: t
34 end type mytype6
35
36 type mytype7
37   sequence
38   type(mytype4) :: t
39 end type mytype7
40
41 common /a/ t1
42 common /b/ t2
43 common /c/ t3  ! { dg-error "has neither the SEQUENCE nor the BIND.C. attribute" }
44 common /d/ t4  ! { dg-error "has an ultimate component that is allocatable" }
45 common /e/ t5
46 common /f/ t6
47 common /f/ t7  ! { dg-error "has an ultimate component that is allocatable" }
48 type(mytype1) :: t1
49 type(mytype2) :: t2
50 type(mytype3) :: t3
51 type(mytype4) :: t4
52 type(mytype5) :: t5
53 type(mytype6) :: t6
54 type(mytype7) :: t7
55 end