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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [equiv_constraint_5.f90] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do compile }
! { dg-options "-O0" }
! PR20902 - Overlapping initializers in an equivalence block must
! have the same value.
!
! The code was replaced completely after the fix for PR30875, which
! is a repeat of the original and comes from the same contributor.
! The fix for 20902 was wrong.
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
  TYPE T1
    sequence
    integer :: i=1
  END TYPE T1
  TYPE T2           ! OK because initializers are equal
    sequence
    integer :: i=1
  END TYPE T2
  TYPE T3
    sequence
    integer :: i=2 ! { dg-error "Overlapping unequal initializers" }
  END TYPE T3
  TYPE(T1) :: a1
  TYPE(T2) :: a2
  TYPE(T3) :: a3
  EQUIVALENCE (a1, a2)
  EQUIVALENCE (a1, a3)
  write(6, *) a1, a2, a3
END

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.