xref: /llvm-project/flang/test/Semantics/resolve115.f90 (revision 227f30a515d7aff0f462bed5fffb85b11ec0bb2a)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Ensures that a generic's shadowed procedure or derived type
3! can be overridden by a valid interior interface definition
4! in some cases.
5
6module m1
7 contains
8  subroutine foo
9  end subroutine
10  subroutine test
11    interface foo
12      subroutine foo(n)
13        integer, intent(in) :: n
14      end subroutine
15    end interface
16    call foo(1)
17  end subroutine
18end module
19
20module m2
21 contains
22  subroutine test
23    interface foo
24      subroutine foo(n)
25        integer, intent(in) :: n
26      end subroutine
27    end interface
28    call foo(1)
29  end subroutine
30  subroutine foo
31  end subroutine
32end module
33
34module m3
35  interface
36    subroutine foo
37    end subroutine
38  end interface
39 contains
40  subroutine test
41    interface foo
42      subroutine foo(n)
43        integer, intent(in) :: n
44      end subroutine
45    end interface
46    call foo(1)
47  end subroutine
48end module
49
50module m4a
51 contains
52  subroutine foo
53  end subroutine
54end module
55module m4b
56  use m4a
57 contains
58  subroutine test
59    interface foo
60      subroutine foo(n)
61        integer, intent(in) :: n
62      end subroutine
63    end interface
64    call foo(1)
65  end subroutine
66end module
67
68module m5
69  type bar
70  end type
71 contains
72  subroutine test
73    interface bar
74      real function bar()
75      end function
76    end interface
77    print *, bar()
78  end subroutine
79end module
80