aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/same_type_as_1.f03
blob: 5f349c7ba075c4ea3cbf0ad58fa9bc9df9e0b276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! { dg-do compile }
!
! Error checking for the intrinsic functions SAME_TYPE_AS and EXTENDS_TYPE_OF.
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

 type :: t1
  integer :: i
 end type

 type :: ts
  sequence
  integer :: j
 end type

 TYPE(t1) :: x1
 TYPE(ts) :: x2

 integer :: i

 print *, SAME_TYPE_AS (i,x1)   ! { dg-error "cannot be of type INTEGER" }
 print *, SAME_TYPE_AS (x1,x2)  ! { dg-error "must be of an extensible type" }

 print *, EXTENDS_TYPE_OF (i,x1)   ! { dg-error "cannot be of type INTEGER" }
 print *, EXTENDS_TYPE_OF (x1,x2)  ! { dg-error "must be of an extensible type" }

end