aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>1998-12-01 09:40:02 +0000
committerNick Clifton <nickc@gcc.gnu.org>1998-12-01 09:40:02 +0000
commitbbe348cd18f81dd9469c81ba6f498e01ca9c5a37 (patch)
treedd3ccc832569e6bb8c97dbd8d9ba8bb123547eca /gcc
parent688d56bc9226567cb9c30655c471cedfbd5e69b9 (diff)
downloadgcc-bbe348cd18f81dd9469c81ba6f498e01ca9c5a37.zip
gcc-bbe348cd18f81dd9469c81ba6f498e01ca9c5a37.tar.gz
gcc-bbe348cd18f81dd9469c81ba6f498e01ca9c5a37.tar.bz2
Add new test based on PR 18365
From-SVN: r24025
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.c-torture/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/981130-1.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/981130-1.x22
3 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog
index 14cd574..2f85aff 100644
--- a/gcc/testsuite/gcc.c-torture/ChangeLog
+++ b/gcc/testsuite/gcc.c-torture/ChangeLog
@@ -1,3 +1,8 @@
+1998-11-30 Nick Clifton <nickc@cygnus.com>
+
+ * execute/981130-1.c: New test.
+ * execute/981130-1.x: New test failure expectations.
+
Sun Oct 11 05:04:28 1998 Ken Raeburn <raeburn@cygnus.com>
* execute/memcheck: New directory of tests for
diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.c b/gcc/testsuite/gcc.c-torture/execute/981130-1.c
new file mode 100644
index 0000000..72630b0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/981130-1.c
@@ -0,0 +1,30 @@
+struct s { int a; int b;};
+struct s s1;
+struct s s2 = { 1, 2, };
+
+void
+check (a, b)
+ int a;
+ int b;
+{
+ if (a == b)
+ exit (0);
+ else
+ abort ();
+}
+
+int
+main ()
+{
+ int * p;
+ int x;
+
+ s1.a = 9;
+ p = & s1.a;
+ s1 = s2;
+ x = * p;
+
+ check (x, 1);
+}
+
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.x b/gcc/testsuite/gcc.c-torture/execute/981130-1.x
new file mode 100644
index 0000000..1565c68
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/981130-1.x
@@ -0,0 +1,22 @@
+# This test is known to fail on targets that use the instruction scheduler
+# at optimisation levels of 2 or more because the alias analysis is confused
+# by the reassignment of a variable structure to a fixed structure. The
+# failure could be suppressed by preventing instruction scheduling:
+#
+# set additional_flags "-fno-schedule-insns2";
+#
+# but this would disguise the fact that there is a problem. Instead we use
+# we generate an xfail result and explain that it is alias analysis that
+# is at fault.
+
+set torture_eval_before_execute {
+
+ set compiler_conditional_xfail_data {
+ "alias analysis conflicts with instruction scheduling" \
+ "m32r-*-*" \
+ { "-O2" "-O1" "-O0" "-Os"} \
+ { "" }
+ }
+}
+
+return 0