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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [derived_function_interface_1.f90] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
! { dg-compile }
! { dg-compile }
! Tests the fix for PR29634, in which an ICE would occur in the
! Tests the fix for PR29634, in which an ICE would occur in the
! interface declaration of a function with an 'old-style' type
! interface declaration of a function with an 'old-style' type
! declaration.  When fixed, it was found that the error message
! declaration.  When fixed, it was found that the error message
! was not very helpful - this was fixed.
! was not very helpful - this was fixed.
!
!
! Contributed by Francois-Xavier Coudert  
! Contributed by Francois-Xavier Coudert  
!
!
type(foo) function ext_fun()
type(foo) function ext_fun()
  type foo
  type foo
    integer :: i
    integer :: i
  end type foo
  end type foo
  ext_fun%i = 1
  ext_fun%i = 1
end function ext_fun
end function ext_fun
  type foo
  type foo
    integer :: i
    integer :: i
  end type foo
  end type foo
  interface fun_interface
  interface fun_interface
    type(foo) function fun()
    type(foo) function fun()
    end function fun
    end function fun
  end interface
  end interface
  interface ext_fun_interface
  interface ext_fun_interface
    type(foo) function ext_fun()
    type(foo) function ext_fun()
    end function ext_fun
    end function ext_fun
  end interface
  end interface
  type(foo) :: x
  type(foo) :: x
  x = ext_fun ()
  x = ext_fun ()
  print *, x%i
  print *, x%i
contains
contains
  type(foo) function fun() ! { dg-error "already has an explicit interface" }
  type(foo) function fun() ! { dg-error "already has an explicit interface" }
  end function fun  ! { dg-error "Expecting END PROGRAM" }
  end function fun  ! { dg-error "Expecting END PROGRAM" }
end
end
 
 

powered by: WebSVN 2.1.0

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