diff libgomp/testsuite/libgomp.c/simd-10.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgomp/testsuite/libgomp.c/simd-10.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-additional-options "-msse2" { target sse2_runtime } } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+int s = 0, i, u;
+
+void
+foo ()
+{
+  #pragma omp for simd schedule(static, 32) reduction(+:s) lastprivate(u)
+  for (i = 0; i < 128; i++)
+    {
+      s++;
+      u = i;
+    }
+  if (i != 128 || s != 128 || u != 127)
+    __builtin_abort ();
+}
+
+int
+main ()
+{
+  foo ();
+  return 0;
+}