summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
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 ();
+}