1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3! Test resolution of type-bound generics.
4
5module m1
6  type :: t
7  contains
8    procedure, pass(x) :: add1 => add
9    procedure, nopass :: add2 => add
10    procedure :: add_real
11    generic :: g => add1, add2, add_real
12  end type
13contains
14  integer function add(x, y)
15    class(t), intent(in) :: x, y
16  end
17  integer function add_real(x, y)
18    class(t), intent(in) :: x
19    real, intent(in) :: y
20  end
21  subroutine test1(x, y, z)
22    type(t) :: x
23    integer :: y
24    integer :: z
25    !ERROR: No specific procedure of generic 'g' matches the actual arguments
26    z = x%g(y)
27  end
28  subroutine test2(x, y, z)
29    type(t) :: x
30    real :: y
31    integer :: z
32    !ERROR: No specific procedure of generic 'g' matches the actual arguments
33    z = x%g(x, y)
34  end
35end
36