OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [interface_3.f90] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR20880, which was due to failure to the failure
3
! to detect the USE association of a nameless interface for a
4
! procedure with the same name as the encompassing scope.
5
!
6
! Contributed by Joost VandeVondele  
7
!
8
module test_mod
9
interface
10
  subroutine my_sub (a)
11
    real a
12
  end subroutine
13
end interface
14
interface
15
  function my_fun (a)
16
    real a, my_fun
17
  end function
18
end interface
19
end module
20
 
21
module test_mod2
22
interface
23
  function my_fun (a)
24
    real a, my_fun
25
  end function
26
end interface
27
end module
28
 
29
 
30
! This is the original PR, excepting that the error requires the symbol
31
! to be referenced.
32
subroutine my_sub (a)
33
  use test_mod
34
  real a
35
  call my_sub (a)  ! { dg-error "ambiguous reference" }
36
  print *, a
37
end subroutine
38
 
39
integer function my_fun (a)
40
  use test_mod
41
  real a
42
  print *, a
43
  my_fun = 1  ! { dg-error "ambiguous reference" }
44
end function
45
 
46
! This was found whilst investigating => segfault
47
subroutine thy_sub (a)
48
  interface
49
    subroutine thy_sub (a) ! { dg-error "enclosing procedure" }
50
      real a
51
    end subroutine
52
  end interface
53
  real a
54
  print *, a
55
end subroutine
56
 
57
subroutine thy_fun (a)
58
  use test_mod
59
  use test_mod2  ! OK because there is no reference to my_fun
60
  print *, a
61
end subroutine thy_fun
62
 
63
subroutine his_fun (a)
64
  use test_mod
65
  use test_mod2
66
  print *, my_fun (a)  ! { dg-error "ambiguous reference" }
67
end subroutine his_fun
68
 
69
! { dg-final { cleanup-modules "test_mod test_mod2" } }

powered by: WebSVN 2.1.0

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