OSDN Git Service

* gcc.c-torture/execute/loop-10.c: New test.
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jan 2002 23:24:33 +0000 (23:24 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jan 2002 23:24:33 +0000 (23:24 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48698 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d9a1885..37e0b7b 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-09  Gwenole Beauchesne  <bgeauchesne@mandrakesoft.com>
+
+       * gcc.c-torture/execute/loop-10.c: New test.
+
 2002-01-09  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c-torture/compile/20010226-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-10.c b/gcc/testsuite/gcc.c-torture/execute/loop-10.c
new file mode 100644 (file)
index 0000000..1a6afba
--- /dev/null
@@ -0,0 +1,31 @@
+/* Reduced from PR optimization/5076, PR optimization/2847 */
+
+static int count = 0;
+
+static void
+inc (void)
+{
+  count++;
+}
+
+int
+main (void)
+{
+  int iNbr = 1;
+  int test = 0;
+  while (test == 0)
+    {
+      inc ();
+      if (iNbr == 0)
+        break;
+      else
+        {
+          inc ();
+          iNbr--;
+        }
+      test = 1;
+    }
+  if (count != 2)
+    abort ();
+  return 0;
+}