xref: /llvm-project/flang/test/Semantics/call20.f90 (revision c6b9df0fbd7fc6f93e3bd7368cf966d55d802f4c)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2
3! Test that the interface of specific intrinsics passed as dummy arguments
4! are correctly validated against actual arguments explicit interface.
5
6  intrinsic :: abs, dabs
7  interface
8    subroutine foo(f)
9      interface
10        function f(x)
11          real :: f
12          real, intent(in) :: x
13        end function
14      end interface
15    end subroutine
16
17    subroutine foo2(f)
18      interface
19        function f(x)
20          double precision :: f
21          double precision, intent(in) :: x
22        end function
23      end interface
24    end subroutine
25  end interface
26
27  ! OK
28  call foo(abs)
29
30  ! OK
31  call foo2(dabs)
32
33  !ERROR: Actual procedure argument has interface incompatible with dummy argument 'f=': function results have distinct types: REAL(4) vs REAL(8)
34  call foo(dabs)
35
36  !ERROR: Actual procedure argument has interface incompatible with dummy argument 'f=': function results have distinct types: REAL(8) vs REAL(4)
37  call foo2(abs)
38end
39