]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.c-torture/execute/990404-1.c: New test.
authorJeffrey A Law <law@cygnus.com>
Sun, 4 Apr 1999 03:03:27 +0000 (03:03 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 4 Apr 1999 03:03:27 +0000 (20:03 -0700)
From-SVN: r26170

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

index 2c4c434b810f3bb9d306c0b64527de8a80884b33..c7c3c06ed33756ac2903ed3ab8996724c8215091 100644 (file)
@@ -1,3 +1,7 @@
+Sun Apr  4 04:02:53 1999  Jeffrey A Law  (law@cygnus.com)
+
+       * gcc.c-torture/execute/990404-1.c: New test.
+
 1999-04-03 10:35 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
 
        * gcc.dg/cpp-if1.c: Adjust regexps to accommodate cccp.
diff --git a/gcc/testsuite/gcc.c-torture/execute/990404-1.c b/gcc/testsuite/gcc.c-torture/execute/990404-1.c
new file mode 100644 (file)
index 0000000..be917d6
--- /dev/null
@@ -0,0 +1,27 @@
+
+int x[10] = { 0,1,2,3,4,5,6,7,8,9};
+
+int
+main()
+{
+  int niterations = 0, i;
+
+  for (;;) {
+    int i, mi, max;
+    max = 0;
+    for (i = 0; i < 10 ; i++) {
+      if (x[i] > max) {
+       max = x[i];
+       mi = i;
+      }
+    }
+    if (max == 0)
+      break;
+    x[mi] = 0;
+    niterations++;
+    if (niterations > 10)
+      abort ();
+  }
+
+  exit (0);
+}