diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/contained_equivalence_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/contained_equivalence_1.f90 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/contained_equivalence_1.f90 b/gcc/testsuite/gfortran.dg/contained_equivalence_1.f90 new file mode 100644 index 000000000..7c6b0126c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/contained_equivalence_1.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! This program tests that equivalence only associates variables in +! the same scope. +! +! provided by Paul Thomas - pault@gcc.gnu.org +! +program contained_equiv + real a + a = 1.0 + call foo () + if (a.ne.1.0) call abort () +contains + subroutine foo () + real b + equivalence (a, b) + b = 2.0 + end subroutine foo +end program contained_equiv |