New test.
authorAlan Modra <amodra@bigpond.net.au>
Sat, 20 Jul 2002 00:33:49 +0000 (00:33 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 20 Jul 2002 00:33:49 +0000 (10:03 +0930)
From-SVN: r55599

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

index 2375247f53a7019f350ce204806ab28350c95aca..16655099ab248a17bc5d06fd96154fd79bbc0704 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-20  Alan Modra  <amodra@bigpond.net.au>
+
+       * gcc.c-torture/execute/loop-13.c: New test.
+
 2002-07-19  Neil Booth  <neil@daikokuya.co.uk>
 
        * gcc.dg/cpp/expr.c: New tests.
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-13.c b/gcc/testsuite/gcc.c-torture/execute/loop-13.c
new file mode 100644 (file)
index 0000000..d56c829
--- /dev/null
@@ -0,0 +1,36 @@
+/* PR opt/7130 */
+#define TYPE long
+
+void
+scale (TYPE *alpha, TYPE *x, int n)
+{
+  int i, ix;
+
+  if (*alpha != 1)
+    for (i = 0, ix = 0; i < n; i++, ix += 2)
+      {
+       TYPE tmpr, tmpi;
+       tmpr = *alpha * x[ix];
+       tmpi = *alpha * x[ix + 1];
+       x[ix] = tmpr;
+       x[ix + 1] = tmpi;
+      }
+}
+
+int
+main (void)
+{
+  int i;
+  TYPE x[10];
+  TYPE alpha = 2;
+
+  for (i = 0; i < 10; i++)
+    x[i] = i;
+
+  scale (&alpha, x, 5);
+
+  if (x[9] != 18)
+    abort ();
+
+  return 0;
+}