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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR29634, in which an ICE would occur in the
3
! interface declaration of a function with an 'old-style' type
4
! declaration.  When fixed, it was found that the error message
5
! was not very helpful - this was fixed.
6
!
7
! Contributed by Francois-Xavier Coudert  
8
!
9
module kinds
10
  type foo
11
    integer :: i
12
  end type foo
13
end module
14
 
15
type(foo) function ext_fun()
16
  use kinds
17
  ext_fun%i = 1
18
end function ext_fun
19
 
20
  use kinds
21
 
22
  interface fun_interface
23
    type(foo) function fun()
24
      use kinds
25
    end function fun
26
  end interface
27
 
28
  interface ext_fun_interface
29
    type(foo) function ext_fun()
30
      use kinds
31
    end function ext_fun
32
  end interface
33
 
34
  type(foo) :: x
35
 
36
  x = ext_fun ()
37
  print *, x%i
38
 
39
contains
40
 
41
  type(foo) function fun() ! { dg-error "already has an explicit interface" }
42
  end function fun  ! { dg-error "Expecting END PROGRAM" }
43
 
44
end
45
! { dg-final { cleanup-modules "kinds" } }

powered by: WebSVN 2.1.0

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