2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / whole_file_20.f03
blobb3f77e4610535876fcf0d00955839bd7de18d61f
1 ! { dg-do compile }
2 ! { dg-options "-fwhole-file -fcoarray=single" }
4 ! Procedures with dummy arguments that are coarrays or polymorphic
5 ! must have an explicit interface in the calling routine.
8 MODULE classtype
9   type :: t
10     integer :: comp
11   end type
12 END MODULE
14 PROGRAM main
15   USE classtype
16   CLASS(t), POINTER :: tt
18   INTEGER :: coarr[*]
20   CALL coarray(coarr)         ! { dg-error "Explicit interface required" }
21   CALL polymorph(tt)          ! { dg-error "Explicit interface required" }
22 END PROGRAM
24 SUBROUTINE coarray(a)
25   INTEGER :: a[*]
26 END SUBROUTINE
28 SUBROUTINE polymorph(b)
29   USE classtype
30   CLASS(t) :: b
31 END SUBROUTINE