OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [generic_19.f90] - Blame information for rev 708

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Test the fix for PR42481, in which 'sub' was not recognised as
3
! a generic interface.
4
!
5
! Contributed by William Mitchell < william.mitchell@nist.gov>
6
!
7
module mod1
8
contains
9
  subroutine sub(x, chr)
10
    real x
11
    character(8) chr
12
    if (trim (chr) .ne. "real") call abort
13
    if (int (x) .ne. 1) call abort
14
  end subroutine sub
15
end module mod1
16
 
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") call abort
27
    if (i .ne. 1) call abort
28
  end subroutine sub_int
29
end module mod2
30
 
31
program prog
32
  use mod1
33
  use mod2
34
  call sub(1, "integer ")
35
  call sub(1.0, "real    ")
36
end program prog
37
! { dg-final { cleanup-modules "mod1 mod2" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.