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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [missing_optional_dummy_2.f90] - Rev 149

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do compile }
! Tests the fix for PR29321 and PR29322, in which ICEs occurred for the
! lack of proper attention to checking pointers in gfc_conv_function_call.
!
! Contributed by Olav Vahtras  <vahtras@pdc.kth.se>
! and Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
!
MODULE myint
   TYPE NUM
      INTEGER :: R = 0
   END TYPE NUM
   CONTAINS 
      FUNCTION FUNC(A,B) RESULT(E)
      IMPLICIT NONE
      TYPE(NUM)  A,B,E
      INTENT(IN) ::  A,B
      OPTIONAL B
      E%R=A%R
      CALL SUB(A,E)
      END FUNCTION FUNC

      SUBROUTINE SUB(A,E,B,C)
      IMPLICIT NONE
      TYPE(NUM) A,E,B,C
      INTENT(IN)   A,B
      INTENT(OUT)  E,C
      OPTIONAL B,C
      E%R=A%R
      END SUBROUTINE SUB
END MODULE myint

  if (isscan () /= 0) call abort
contains
  integer function isscan (substr)
    character(*), optional :: substr
    if (.not.present(substr)) isscan = myscan ("foo", "over")
  end function isscan
end
! { dg-final { cleanup-modules "myint" } }

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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