re PR c++/84556 (C++17, lambda, OpenMP simd: sorry, unimplemented: unexpected AST)
authorJakub Jelinek <jakub@redhat.com>
Mon, 26 Feb 2018 10:18:31 +0000 (11:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 26 Feb 2018 10:18:31 +0000 (11:18 +0100)
PR c++/84556
* g++.dg/gomp/pr84556.C: New test.
* g++.dg/vect/pr84556.cc: New test.

From-SVN: r257986

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr84556.C [new file with mode: 0644]
gcc/testsuite/g++.dg/vect/pr84556.cc [new file with mode: 0644]

index 3e0299c2f692586da592cf32a794432b433dd121..ba3101dd634d66b4b8977095e28fa5680c758f76 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84556
+       * g++.dg/gomp/pr84556.C: New test.
+       * g++.dg/vect/pr84556.cc: New test.
+
 2018-02-26  Dominique d'Humieres <dominiq@gcc.gnu.org>
 
        PR fortran/32957
diff --git a/gcc/testsuite/g++.dg/gomp/pr84556.C b/gcc/testsuite/g++.dg/gomp/pr84556.C
new file mode 100644 (file)
index 0000000..188d5a4
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/84556
+// { dg-do compile }
+// { dg-options "-std=c++17 -fopenmp-simd" }
+
+void
+foo ()
+{
+  auto x = [] ()
+  {
+    #pragma omp simd
+    for (int i = 0; i < 8; ++i)
+      ;
+  };
+}
diff --git a/gcc/testsuite/g++.dg/vect/pr84556.cc b/gcc/testsuite/g++.dg/vect/pr84556.cc
new file mode 100644 (file)
index 0000000..e065553
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/84556
+// { dg-do run { target c++11 } }
+// { dg-options "-O2 -fopenmp-simd" }
+// { dg-additional-options "-mavx" { target avx_runtime } }
+
+int
+main ()
+{
+  int y[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+  auto x = [&y] ()
+  {
+    #pragma omp simd
+    for (int i = 0; i < 8; ++i)
+      y[i]++;
+  };
+  x ();
+  x ();
+  for (int i = 0; i < 8; ++i)
+    if (y[i] != i + 3)
+      __builtin_abort ();
+}