view gcc/testsuite/gfortran.dg/pr94030_2.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

! { dg-do compile }
!
! Provided by Steve Kargl.

subroutine foo(n,m)
  integer, intent(in) :: n, m
  integer a(n)
  real b(n)
  equivalence(a,b)
  if (m /= 2) then
      a = 1
      print *, a(1)
  else
      b = 42.
      print *, b(1)
   end if
end subroutine 

subroutine bar(m)
  integer, intent(in) :: m
  integer x(8)
  real y(8)
  equivalence(x,y)
  if (m /= 2) then
      x = 1
      print *, x(1)
  else
      y = 42.
      print *, y(1)
   end if
end subroutine 

! { dg-error "Array '.' at .1. with non-constant bounds cannot be an EQUIVALENCE object" " " { target *-*-* } 9 }