summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-21 10:58:00 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-21 10:58:00 +0000
commit23a7b91ba16742fbda2637f6fcbd156cc7fc54ab (patch)
treea1bba68984c40a32b45cc159beb1301d2f80d6f7 /libgomp
parente815fba032bf8d5cdc9034823a2695bf7d29472d (diff)
downloadgcc-23a7b91ba16742fbda2637f6fcbd156cc7fc54ab.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249445 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr81130.C41
2 files changed, 46 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 9f4b0527746..da9946fed94 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/81130
+ * testsuite/libgomp.c++/pr81130.C: New test.
+
2017-06-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/libgomp.fortran/strassen.f90: Remove dg-skip-if
diff --git a/libgomp/testsuite/libgomp.c++/pr81130.C b/libgomp/testsuite/libgomp.c++/pr81130.C
new file mode 100644
index 00000000000..f2cb571294d
--- /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 ();
+}