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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [interface_5.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
! Tests the fix for the interface bit of PR29975, in which the
3
! interfaces bl_copy were rejected as ambiguous, even though
4
! they import different specific interfaces.  In this testcase,
5
! it is verified that ambiguous specific interfaces are caught.
6
!
7
! Contributed by Joost VandeVondele  and
8
! simplified by Tobias Burnus 
9
!
10
SUBROUTINE RECOPY(N, c)
11
  real, INTENT(IN) :: N
12
  character(6) :: c
13
  print *, n
14
  c = "recopy"
15
END SUBROUTINE RECOPY
16
 
17
MODULE f77_blas_extra
18
PUBLIC :: BL_COPY
19
INTERFACE BL_COPY
20
  MODULE PROCEDURE SDCOPY
21
END INTERFACE BL_COPY
22
CONTAINS
23
   SUBROUTINE SDCOPY(N, c)
24
    REAL, INTENT(IN) :: N
25
    character(6) :: c
26
    print *, n
27
    c = "sdcopy"
28
   END SUBROUTINE SDCOPY
29
END MODULE f77_blas_extra
30
 
31
MODULE f77_blas_generic
32
INTERFACE BL_COPY
33
   SUBROUTINE RECOPY(N, c)
34
    real, INTENT(IN) :: N
35
    character(6) :: c
36
   END SUBROUTINE RECOPY
37
END INTERFACE BL_COPY
38
END MODULE f77_blas_generic
39
 
40
subroutine i_am_ok
41
  USE f77_blas_extra ! { dg-warning "ambiguous interfaces" }
42
  USE f77_blas_generic
43
  character(6) :: chr
44
  chr = ""
45
  if (chr /= "recopy") call abort ()
46
end subroutine i_am_ok
47
 
48
program main
49
  USE f77_blas_extra ! { dg-error "Ambiguous interfaces" }
50
  USE f77_blas_generic
51
  character(6) :: chr
52
  chr = ""
53
  call bl_copy(1.0, chr)
54
  if (chr /= "recopy") call abort ()
55
end program main
56
! { dg-final { cleanup-modules "f77_blas_generic f77_blas_extra" } }

powered by: WebSVN 2.1.0

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