[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve24.f90
blobc6306fbea5944e5f92aefb70379b06e68797c840
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 subroutine test1
4 !ERROR: Generic interface 'foo' has both a function and a subroutine
5 interface foo
6 subroutine s1(x)
7 end subroutine
8 subroutine s2(x, y)
9 end subroutine
10 function f()
11 end function
12 end interface
13 end subroutine
15 subroutine test2
16 !ERROR: Generic interface 'foo' has both a function and a subroutine
17 interface foo
18 function f1(x)
19 end function
20 subroutine s()
21 end subroutine
22 function f2(x, y)
23 end function
24 end interface
25 end subroutine
27 module test3
28 !ERROR: Generic interface 'foo' has both a function and a subroutine
29 interface foo
30 module procedure s
31 module procedure f
32 end interface
33 contains
34 subroutine s(x)
35 end subroutine
36 function f()
37 end function
38 end module
40 subroutine test4
41 type foo
42 end type
43 !ERROR: Generic interface 'foo' may only contain functions due to derived type with same name
44 interface foo
45 subroutine s()
46 end subroutine
47 end interface
48 end subroutine
50 subroutine test5
51 interface foo
52 function f1()
53 end function
54 end interface
55 interface bar
56 subroutine s1()
57 end subroutine
58 subroutine s2(x)
59 end subroutine
60 end interface
61 !ERROR: Cannot call function 'foo' like a subroutine
62 call foo()
63 !ERROR: Cannot call subroutine 'bar' like a function
64 x = bar()
65 end subroutine