PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / generic_19.f90
blobf2144d14bcf724553d26f70972a4e22e0e525f2a
1 ! { dg-do compile }
2 ! Test the fix for PR42481, in which 'sub' was not recognised as
3 ! a generic interface.
5 ! Contributed by William Mitchell < william.mitchell@nist.gov>
7 module mod1
8 contains
9 subroutine sub(x, chr)
10 real x
11 character(8) chr
12 if (trim (chr) .ne. "real") STOP 1
13 if (int (x) .ne. 1) STOP 2
14 end subroutine sub
15 end module mod1
17 module mod2
18 use mod1
19 interface sub
20 module procedure sub, sub_int
21 end interface sub
22 contains
23 subroutine sub_int(i, chr)
24 character(8) chr
25 integer i
26 if (trim (chr) .ne. "integer") STOP 3
27 if (i .ne. 1) STOP 4
28 end subroutine sub_int
29 end module mod2
31 program prog
32 use mod1
33 use mod2
34 call sub(1, "integer ")
35 call sub(1.0, "real ")
36 end program prog