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

Subversion Repositories openrisc

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

Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
! { dg-do compile }
! { dg-do compile }
! This checks the fix for PR20889 in wrong pointer types in derived
! This checks the fix for PR20889 in wrong pointer types in derived
! type constructors would either give no message or would segfault.
! type constructors would either give no message or would segfault.
!
!
! Contributed by Joost VandVondele  
! Contributed by Joost VandVondele  
!==============
!==============
  TYPE TEST
  TYPE TEST
    REAL, POINTER :: A
    REAL, POINTER :: A
  END TYPE
  END TYPE
  TYPE TEST1
  TYPE TEST1
    REAL :: A
    REAL :: A
  END TYPE
  END TYPE
  INTEGER, POINTER :: IP
  INTEGER, POINTER :: IP
  real, POINTER :: RP
  real, POINTER :: RP
  TYPE(TEST) :: DD
  TYPE(TEST) :: DD
  TYPE(TEST1) :: EE
  TYPE(TEST1) :: EE
! Next line is the original => gave no warning/error.
! Next line is the original => gave no warning/error.
  DD=TEST(NULL(IP))    ! { dg-error "INTEGER but should be REAL" }
  DD=TEST(NULL(IP))    ! { dg-error "INTEGER but should be REAL" }
! Would segfault here.
! Would segfault here.
  DD=TEST(IP)          ! { dg-error "INTEGER but should be REAL" }
  DD=TEST(IP)          ! { dg-error "INTEGER but should be REAL" }
! Check right target type is OK.
! Check right target type is OK.
  DD=TEST(NULL(RP))
  DD=TEST(NULL(RP))
! Check non-pointer is OK.
! Check non-pointer is OK.
  EE= TEST1(1)
  EE= TEST1(1)
! Test attempted conversion from character to real.
! Test attempted conversion from character to real.
  EE= TEST1("e")       ! { dg-error "convert CHARACTER" }
  EE= TEST1("e")       ! { dg-error "convert CHARACTER" }
 
 

powered by: WebSVN 2.1.0

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