blob: 84bfdeaa819316b39313af341753592b8dd52f82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
! { 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 }
|