PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_24.f90
blobf97d2babcdb99020df9b47a7f67f81ecc1599b2e
1 ! { dg-do compile }
3 ! This tests the fix for PR36361: If a function was declared in an INTERFACE
4 ! statement, no attributes may be declared outside of the INTERFACE body.
6 ! Contributed by Janus Weil <janus@gcc.gnu.org>
8 module m1
9 interface
10 real function f1()
11 end function
12 end interface
13 dimension :: f1(4) ! { dg-error "outside its INTERFACE body" }
14 end module
17 module m2
18 dimension :: f2(4)
19 interface
20 real function f2() ! { dg-error "outside its INTERFACE body" }
21 !end function
22 end interface
23 end module
26 ! valid
27 module m3
28 interface
29 real function f3()
30 dimension :: f3(4)
31 end function
32 end interface
33 end module
36 module m4
37 interface
38 function f4() ! { dg-error "cannot have a deferred shape" }
39 real :: f4(:)
40 end function
41 end interface
42 allocatable :: f4 ! { dg-error "outside of INTERFACE body" }
43 end module
46 module m5
47 allocatable :: f5(:)
48 interface
49 function f5() ! { dg-error "outside its INTERFACE body" }
50 !real f5(:)
51 !end function
52 end interface
53 end module
56 !valid
57 module m6
58 interface
59 function f6()
60 real f6(:)
61 allocatable :: f6
62 end function
63 end interface
64 end module