[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve68.f90
blob28d90a68d1ff1b61423d992216ea028d39a8a8ac
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test resolution of type-bound generics.
4 module m1
5 type :: t
6 contains
7 procedure, pass(x) :: add1 => add
8 procedure, nopass :: add2 => add
9 procedure :: add_real
10 generic :: g => add1, add2, add_real
11 end type
12 contains
13 integer function add(x, y)
14 class(t), intent(in) :: x, y
15 end
16 integer function add_real(x, y)
17 class(t), intent(in) :: x
18 real, intent(in) :: y
19 end
20 subroutine test1(x, y, z)
21 type(t) :: x
22 integer :: y
23 integer :: z
24 !ERROR: No specific function of generic 'g' matches the actual arguments
25 z = x%g(y)
26 end
27 subroutine test2(x, y, z)
28 type(t) :: x
29 real :: y
30 integer :: z
31 !ERROR: No specific function of generic 'g' matches the actual arguments
32 z = x%g(x, y)
33 end
34 end