From: Jakub Jelinek Date: Mon, 26 Feb 2018 10:18:31 +0000 (+0100) Subject: re PR c++/84556 (C++17, lambda, OpenMP simd: sorry, unimplemented: unexpected AST) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8562191ad25bd094d393ef4e65b96542a14e8fab;p=gcc.git re PR c++/84556 (C++17, lambda, OpenMP simd: sorry, unimplemented: unexpected AST) PR c++/84556 * g++.dg/gomp/pr84556.C: New test. * g++.dg/vect/pr84556.cc: New test. From-SVN: r257986 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3e0299c2f69..ba3101dd634 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-02-26 Jakub Jelinek + + PR c++/84556 + * g++.dg/gomp/pr84556.C: New test. + * g++.dg/vect/pr84556.cc: New test. + 2018-02-26 Dominique d'Humieres 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 index 00000000000..188d5a49b91 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr84556.C @@ -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 index 00000000000..e0655536f7a --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr84556.cc @@ -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 (); +}