* gcc.dg/20000108-1.c: New test.
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Sat, 8 Jan 2000 19:53:48 +0000 (19:53 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 8 Jan 2000 19:53:48 +0000 (19:53 +0000)
From-SVN: r31286

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20000108-1.c [new file with mode: 0644]

index e350c0d..5261760 100644 (file)
@@ -1,3 +1,7 @@
+2000-01-08  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * gcc.dg/20000108-1.c: New test.
+
 2000-01-05  Nathan Sidwell  <nathan@acm.org>
 
        * g++.old-deja/g++.ns/koenig8.C: New test.
diff --git a/gcc/testsuite/gcc.dg/20000108-1.c b/gcc/testsuite/gcc.dg/20000108-1.c
new file mode 100644 (file)
index 0000000..4afbc09
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000  Free Software Foundation.
+
+   by Alexandre Oliva  <oliva@lsd.ic.unicamp.br>  */
+
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+void foo () {} /* unused, but essential to trigger the bug */
+
+int main () {
+  int i;
+  /* use asms to prevent optimizations */
+  /* i = -1; */ asm ("" : "=r" (i) : "0" (-1));
+  /* i =  1; */ asm ("" : "=r" (i) : "0" (i ? 1 : 2));
+  if (i != 1)
+    abort();
+}