[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve24.f90
blob0b61a50065ded2c7ca63ed2cdc680285165c1281
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 subroutine test1
3 !ERROR: Generic interface 'foo' has both a function and a subroutine
4 interface foo
5 subroutine s1(x)
6 end subroutine
7 subroutine s2(x, y)
8 end subroutine
9 function f()
10 end function
11 end interface
12 end subroutine
14 subroutine test2
15 !ERROR: Generic interface 'foo' has both a function and a subroutine
16 interface foo
17 function f1(x)
18 end function
19 subroutine s()
20 end subroutine
21 function f2(x, y)
22 end function
23 end interface
24 end subroutine
26 module test3
27 !ERROR: Generic interface 'foo' has both a function and a subroutine
28 interface foo
29 module procedure s
30 module procedure f
31 end interface
32 contains
33 subroutine s(x)
34 end subroutine
35 function f()
36 end function
37 end module
39 subroutine test4
40 type foo
41 end type
42 !ERROR: Generic interface 'foo' may only contain functions due to derived type with same name
43 interface foo
44 subroutine s()
45 end subroutine
46 end interface
47 end subroutine
49 subroutine test5
50 interface foo
51 function f1()
52 end function
53 end interface
54 interface bar
55 subroutine s1()
56 end subroutine
57 subroutine s2(x)
58 end subroutine
59 end interface
60 !ERROR: Cannot call function 'foo' like a subroutine
61 call foo()
62 !ERROR: Cannot call subroutine 'bar' like a function
63 x = bar()
64 end subroutine