2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / generic_actual_arg.f90
blob9c1fc3e728a4f405b0d309ff3d98a7b5ab0304f9
1 ! { dg-do compile }
2 ! Tests fix for PR20886 in which the passing of a generic procedure as
3 ! an actual argument was not detected.
5 ! The second module and the check that CALCULATION2 is a good actual
6 ! argument was added following the fix for PR26374.
8 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
10 MODULE TEST
11 INTERFACE CALCULATION
12 MODULE PROCEDURE C1, C2
13 END INTERFACE
14 CONTAINS
15 SUBROUTINE C1(r)
16 INTEGER :: r
17 END SUBROUTINE
18 SUBROUTINE C2(r)
19 REAL :: r
20 END SUBROUTINE
21 END MODULE TEST
23 MODULE TEST2
24 INTERFACE CALCULATION2
25 MODULE PROCEDURE CALCULATION2, C3
26 END INTERFACE
27 CONTAINS
28 SUBROUTINE CALCULATION2(r)
29 INTEGER :: r
30 END SUBROUTINE
31 SUBROUTINE C3(r)
32 REAL :: r
33 END SUBROUTINE
34 END MODULE TEST2
36 USE TEST
37 USE TEST2
38 CALL F(CALCULATION) ! { dg-error "GENERIC procedure" }
40 CALL F(CALCULATION2) ! OK because there is a same name specific, but: ! { dg-error "More actual than formal arguments" }
41 END
43 SUBROUTINE F()
44 END SUBROUTINE