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 "cannot be of type INTEGER" } 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 "cannot be of type INTEGER" } 25 print *, EXTENDS_TYPE_OF (x1,x2) ! { dg-error "must be of an extensible type" } 26 27end 28