OSDN Git Service

2010-09-05 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / same_type_as_1.f03
1 ! { dg-do compile }
2 !
3 ! Error checking for the intrinsic functions SAME_TYPE_AS and EXTENDS_TYPE_OF.
4 !
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7  type :: t1
8   integer :: i
9  end type 
10
11  type :: ts
12   sequence
13   integer :: j
14  end type
15
16  TYPE(t1) :: x1
17  TYPE(ts) :: x2
18
19  integer :: i
20
21  print *, SAME_TYPE_AS (i,x1)   ! { dg-error "must be of a derived type" }
22  print *, SAME_TYPE_AS (x1,x2)  ! { dg-error "must be of an extensible type" }
23
24  print *, EXTENDS_TYPE_OF (i,x1)   ! { dg-error "must be of a derived type" }
25  print *, EXTENDS_TYPE_OF (x1,x2)  ! { dg-error "must be of an extensible type" }
26
27 end