diff gcc/testsuite/gcc.dg/vect/pr83857.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/vect/pr83857.c	Thu Oct 25 07:37:49 2018 +0900
@@ -0,0 +1,29 @@
+/* { dg-additional-options "-ffast-math" } */
+
+#define N 100
+
+double __attribute__ ((noinline, noclone))
+f (double *x, double y)
+{
+  double a = 0;
+  for (int i = 0; i < N; ++i)
+    {
+      a += y;
+      x[i * 2] += a;
+      x[i * 2 + 1] += a;
+    }
+  return a - y;
+}
+
+double x[N * 2];
+
+int
+main (void)
+{
+  if (f (x, 5) != (N - 1) * 5)
+    __builtin_abort ();
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" { target vect_double } } } */
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_double } } } */