From d54d1fc3bcd2d3dda563f9bd95b60299bc892041 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 21 Jun 2017 12:58:00 +0200 Subject: re PR c++/81130 (ICE OpenMP shared clause in gimplify_var_or_parm_decl, at gimplify.c:2584) PR c++/81130 * gimplify.c (omp_add_variable): Don't force GOVD_SEEN for types with ctors/dtors if GOVD_SHARED is set. * testsuite/libgomp.c++/pr81130.C: New test. From-SVN: r249445 --- libgomp/testsuite/libgomp.c++/pr81130.C | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c++/pr81130.C (limited to 'libgomp/testsuite') diff --git a/libgomp/testsuite/libgomp.c++/pr81130.C b/libgomp/testsuite/libgomp.c++/pr81130.C new file mode 100644 index 0000000..f2cb571 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr81130.C @@ -0,0 +1,41 @@ +// PR c++/81130 +// { dg-do run } + +struct A +{ + A (); + ~A (); + int a; +}; + +A::A () +{ + a = 0; +} + +A::~A () +{ +} + +struct B +{ + A b; + int c; + B () : c (1) + { +#pragma omp parallel shared (b, c) num_threads (2) +#pragma omp master + { + b.a++; + c += 2; + } + } +}; + +int +main () +{ + B v; + if (v.b.a != 1 || v.c != 3) + __builtin_abort (); +} -- cgit v1.1