new testcase for MVE
authorRevital Eres <eres@il.ibm.com>
Sun, 22 Apr 2007 08:51:50 +0000 (08:51 +0000)
committerRevital Eres <revitale@gcc.gnu.org>
Sun, 22 Apr 2007 08:51:50 +0000 (08:51 +0000)
From-SVN: r124038

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/var-expand2.c [new file with mode: 0644]

index ad4462e4e37469409220408385d69415fb7e2a0a..a1ccf5e9074813bc7277aac6f58575656a620604 100644 (file)
@@ -1,3 +1,7 @@
+2007-04-22  Revital Eres  <eres@il.ibm.com>
+
+        * gcc.dg/var-expand2.c: New test.
+
 2007-04-22  Revital Eres  <eres@il.ibm.com>
 
        * gcc.dg/var-expand3.c: New test.
diff --git a/gcc/testsuite/gcc.dg/var-expand2.c b/gcc/testsuite/gcc.dg/var-expand2.c
new file mode 100644 (file)
index 0000000..499de55
--- /dev/null
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller" } */
+
+extern void abort (void);
+
+float array[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+int
+foo (int n)
+{
+  unsigned i;
+  float accum = 0;
+
+  for (i = 0; i < n; i++)
+    accum += array[i];
+
+  if (accum != 55)
+    abort ();
+
+  return 0;
+}
+
+int
+main (void)
+{
+  return foo (10);
+}
+
+