* gcc.c-torture/execute/20010119-1.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 Jan 2001 18:03:44 +0000 (19:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 19 Jan 2001 18:03:44 +0000 (19:03 +0100)
From-SVN: r39138

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

index b8b57aff7db6685d031b352b609585129a1fa8b3..80db728b0c2444182901aa79ff3b77d043e6633a 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20010119-1.c: New test.
+
 2001-01-19  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.other/vbase5.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010119-1.c b/gcc/testsuite/gcc.c-torture/execute/20010119-1.c
new file mode 100644 (file)
index 0000000..c2a691a
--- /dev/null
@@ -0,0 +1,23 @@
+#ifdef __OPTIMIZE__
+extern void undef (void);
+
+void bar (unsigned x) { }
+void baz (unsigned x) { }
+
+extern inline void foo (int a, int b)
+{
+  int c = 0;
+  while (c++ < b)
+    (__builtin_constant_p (a) ? ((a) > 20000 ? undef () : bar (a)) : baz (a));
+}
+#else
+void foo (int a, int b)
+{
+}
+#endif
+
+int main (void)
+{
+  foo(10, 100);
+  exit (0);
+}