URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [defined_operators_1.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do compile }! { dg-options "-std=legacy" }! Tests the fix for PR27122, in which the requirements of 12.3.2.1.1! for defined operators were not enforced.!! Based on PR test by Thomas Koenig <tkoenig@gcc.gnu.org>!module mymodinterface operator (.foo.)module procedure foo_0module procedure foo_1module procedure foo_2module procedure foo_3module procedure foo_1_OK ! { dg-error "Ambiguous interfaces" }module procedure foo_2_OKfunction foo_chr (chr) ! { dg-error "cannot be assumed character length" }character(*) :: foo_chrcharacter(*), intent(in) :: chrend function foo_chrsubroutine bad_foo (chr) ! { dg-error "must be a FUNCTION" }character(*), intent(in) :: chrend subroutine bad_fooend interfacecontainsfunction foo_0 () ! { dg-error "must have at least one argument" }integer :: foo_1foo_0 = 1end function foo_0function foo_1 (a) ! { dg-error "must be INTENT" }integer :: foo_1integer :: afoo_1 = 1end function foo_1function foo_1_OK (a)integer :: foo_1_OKinteger, intent (in) :: afoo_1_OK = 1end function foo_1_OKfunction foo_2 (a, b) ! { dg-error "cannot be optional" }integer :: foo_2integer, intent(in) :: ainteger, intent(in), optional :: bfoo_2 = 2 * a + bend function foo_2function foo_2_OK (a, b)real :: foo_2_OKreal, intent(in) :: areal, intent(in) :: bfoo_2_OK = 2.0 * a + bend function foo_2_OKfunction foo_3 (a, b, c) ! { dg-error "must have, at most, two arguments" }integer :: foo_3integer, intent(in) :: a, b, cfoo_3 = a + 3 * b - cend function foo_3end module mymod! { dg-final { cleanup-modules "mymod" } }
