1! { dg-do compile }
2!
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.
5!
6! Contributed by Janus Weil <janus@gcc.gnu.org>
7
8module m1
9  interface
10    real function f1()
11    end function
12  end interface
13  dimension :: f1(4)  ! { dg-error "outside its INTERFACE body" }
14end module
15
16
17module m2
18  dimension :: f2(4)
19  interface
20    real function f2()  ! { dg-error "outside its INTERFACE body" }
21    !end function
22  end interface
23end module
24
25
26! valid
27module m3
28  interface
29    real function f3()
30      dimension :: f3(4)
31    end function
32  end interface
33end module
34
35
36module 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" }
43end module
44
45
46module m5
47  allocatable :: f5(:)
48  interface
49    function f5()  ! { dg-error "outside its INTERFACE body" }
50      !real f5(:)
51    !end function
52  end interface
53end module
54
55
56!valid
57module m6
58  interface
59    function f6()
60      real f6(:)
61      allocatable :: f6
62    end function
63  end interface
64end module
65