Debian Codegraph @

gcc/testsuite/gfortran.dg/interface_55.f90

raw
1 ! { dg-do run }
2 ! { dg-additional-options "-Wexternal-argument-mismatch" }
3 ! PR 119074 - the code is legal, but it makes sense to warn anyway.
4
5 program main
6 external ex1,ex2
7 call foo(ex1,1)
8 call foo(ex2,2)
9 end program main
10
11 subroutine ex1(n)
12 integer :: n
13 if (n /= 1) error stop
14 end subroutine ex1
15
16 subroutine ex2(n,m)
17 integer :: n,m
18 if (n /= 2) error stop
19 if (m /= 3) error stop
20 end subroutine ex2
21
22 subroutine foo(a,n)
23 external a
24 if (n == 1) call a(1) ! { dg-warning "Different argument lists" }
25 if (n == 2) call a(2,3) ! { dg-warning "Different argument lists" }
26 end subroutine foo