This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testcase for PR target/7559
- From: Andreas Jaeger <aj at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 06 Oct 2002 18:57:17 +0200
- Subject: Testcase for PR target/7559
I've just closed this bugreport and will add soon (currently ssh to
gcc.gnu.org is broken for me) this testcase that came with the patch.
Andreas
2002-10-06 Andreas Jaeger <aj@suse.de>
* gcc.dg/20021006-1.c: Testcase from PR 7559.
============================================================
Index: gcc/testsuite/gcc.dg/20021006-1.c
--- gcc/testsuite/gcc.dg/20021006-1.c created
+++ gcc/testsuite/gcc.dg/20021006-1.c Sun Oct 6 18:52:35 2002 1.1
@@ -0,0 +1,27 @@
+/* PR target/7559
+ This testcase was miscompiled on x86-64 due to wrong access to the struct
+ members. */
+
+extern void abort();
+
+struct A {
+ long x;
+};
+
+struct R {
+ struct A a, b;
+};
+
+struct R R = {
+ {100}, {200}
+};
+
+void f(struct R r) {
+ if (r.a.x != R.a.x || r.b.x != R.b.x)
+ abort();
+}
+
+int main() {
+ f(R);
+ return 0;
+}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj