summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/common_equivalence_1.f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/common_equivalence_1.f')
-rw-r--r--gcc/testsuite/gfortran.dg/common_equivalence_1.f21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/common_equivalence_1.f b/gcc/testsuite/gfortran.dg/common_equivalence_1.f
new file mode 100644
index 000000000..2f15b93a4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/common_equivalence_1.f
@@ -0,0 +1,21 @@
+c { dg-do run }
+c This program tests the fix for PR22304.
+c
+c provided by Paul Thomas - pault@gcc.gnu.org
+c
+ integer a(2), b, c
+ COMMON /foo/ a
+ EQUIVALENCE (a(1),b), (c, a(2))
+ a(1) = 101
+ a(2) = 102
+ call bar ()
+ END
+
+ subroutine bar ()
+ integer a(2), b, c, d
+ COMMON /foo/ a
+ EQUIVALENCE (a(1),b), (c, a(2))
+ if (b.ne.101) call abort ()
+ if (c.ne.102) call abort ()
+ END
+