Add new test based on PR 18365
authorNick Clifton <nickc@cygnus.com>
Tue, 1 Dec 1998 09:40:02 +0000 (09:40 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 1 Dec 1998 09:40:02 +0000 (09:40 +0000)
From-SVN: r24025

gcc/testsuite/gcc.c-torture/ChangeLog
gcc/testsuite/gcc.c-torture/execute/981130-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/981130-1.x [new file with mode: 0644]

index 14cd57461468af0889f330917690b17ca1455eb2..2f85aff5f48e8f2f936ffcad0c423130278b4308 100644 (file)
@@ -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 (file)
index 0000000..72630b0
--- /dev/null
@@ -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 (file)
index 0000000..1565c68
--- /dev/null
@@ -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