OSDN Git Service

* gcc.c-torture/execute/990404-1.c: New test.
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Apr 1999 03:03:27 +0000 (03:03 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Apr 1999 03:03:27 +0000 (03:03 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26170 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 2c4c434..c7c3c06 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);
+}