Commit c95ee96b by Mark Eggleston Committed by Mark Eggleston

Additional test cases for using automatic variables in equivalence statements.

From-SVN: r277097
parent 7fa848b5
2019-10-17 Mark Eggleston <mark.eggleston@codethink.com>
* gfortran.dg/auto_in_equiv_3.f90: New test.
* gfortran.dg/auto_in_equiv_4.f90: New test.
* gfortran.dg/auto_in_equiv_5.f90: New test.
* gfortran.dg/auto_in_equiv_6.f90: New test.
* gfortran.dg/auto_in_equiv_7.f90: New test.
2019-10-17 Georg-Johann Lay <avr@gjlay.de> 2019-10-17 Georg-Johann Lay <avr@gjlay.de>
* gcc.target/avr/progmem-error-1.cpp: Fix location of the * gcc.target/avr/progmem-error-1.cpp: Fix location of the
......
! { dg-do compile }
! { dg-options "-fdec-static -fdump-tree-original" }
!
subroutine foo
integer, automatic :: a
integer :: b
equivalence (a, b)
a = 5
if (b.ne.5) stop 1
end subroutine
! { dg-final { scan-tree-dump "union" "original" } }
! { dg-final { scan-tree-dump-not "static union" "original" } }
! { dg-final { scan-tree-dump "integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump-not "static integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump "integer\\(kind=4\\) b" "original" } }
! { dg-final { scan-tree-dump-not "static integer\\(kind=4\\) b" "original" } }
! { dg-do compile }
! { dg-options "-fdec-static -fno-automatic -fdump-tree-original" }
!
! Neither of the local variable have the automatic attribute so they
! not be allocated on the stack.
subroutine foo
integer :: a
integer :: b
equivalence (a, b)
a = 5
if (b.ne.5) stop 1
end subroutine
! { dg-final { scan-tree-dump "static union" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) b" "original" } }
! { dg-do compile }
! { dg-options "-fdump-tree-original" }
!
! Neither of the local variable have the automatic attribute so they
! not be allocated on the stack.
subroutine foo
integer, save :: a
integer :: b
equivalence (a, b)
a = 5
if (b.ne.5) stop 1
end subroutine
! { dg-final { scan-tree-dump "static union" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) b" "original" } }
! { dg-do compile }
! { dg-options "-fdec-static -fdump-tree-original" }
!
! Neither of the local variable have the automatic attribute so they
! not be allocated on the stack.
subroutine foo
integer, static :: a
integer :: b
equivalence (a, b)
a = 5
if (b.ne.5) stop 1
end subroutine
! { dg-final { scan-tree-dump "static union" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump "static integer\\(kind=4\\) b" "original" } }
! { dg-do compile }
! { dg-options "-fdec-static -fdump-tree-original" }
!
subroutine foo
integer :: a
integer, automatic :: b
equivalence (a, b)
a = 5
if (b.ne.5) stop 1
end subroutine
! { dg-final { scan-tree-dump "union" "original" } }
! { dg-final { scan-tree-dump-not "static union" "original" } }
! { dg-final { scan-tree-dump "integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump-not "static integer\\(kind=4\\) a" "original" } }
! { dg-final { scan-tree-dump "integer\\(kind=4\\) b" "original" } }
! { dg-final { scan-tree-dump-not "static integer\\(kind=4\\) b" "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment