summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 14:48:41 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 14:48:41 +0000
commitddc84b79a05199589ffba0398f381b176b7a3ed1 (patch)
tree272f5f6e6826a0d941344d97a0162268bc162244 /libgomp
parentd63aa423c50c3c0b73b9dbfcc5c9a7209910c96f (diff)
downloadgcc-ddc84b79a05199589ffba0398f381b176b7a3ed1.tar.gz
PR c/64824
* c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec check in the POP macro. * testsuite/libgomp.c/atomic-18.c: New test. * testsuite/libgomp.c++/atomic-16.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@220624 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libgomp/testsuite/libgomp.c++/atomic-16.C5
-rw-r--r--libgomp/testsuite/libgomp.c/atomic-18.c61
3 files changed, 70 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 39f693d8d55..c1a983a5094 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,5 +1,9 @@
2015-02-11 Jakub Jelinek <jakub@redhat.com>
+ PR c/64824
+ * testsuite/libgomp.c/atomic-18.c: New test.
+ * testsuite/libgomp.c++/atomic-16.C: New test.
+
Backported from mainline
2015-02-04 Jakub Jelinek <jakub@redhat.com>
diff --git a/libgomp/testsuite/libgomp.c++/atomic-16.C b/libgomp/testsuite/libgomp.c++/atomic-16.C
new file mode 100644
index 00000000000..afccd52bb66
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/atomic-16.C
@@ -0,0 +1,5 @@
+// PR c/64824
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/atomic-18.c"
diff --git a/libgomp/testsuite/libgomp.c/atomic-18.c b/libgomp/testsuite/libgomp.c/atomic-18.c
new file mode 100644
index 00000000000..bd048c1094c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/atomic-18.c
@@ -0,0 +1,61 @@
+/* PR c/64824 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+void
+f1 (void)
+{
+ short a;
+ short b = 1;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6 || a != 6)
+ __builtin_abort ();
+}
+
+void
+f2 (void)
+{
+ short a;
+ short b = 1;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c + b;
+ if (b != 4 || a != 4)
+ __builtin_abort ();
+}
+
+void
+f3 (void)
+{
+ short a;
+ short b = 1;
+ long long int c = 3;
+#pragma omp atomic capture
+ a = b = c + b;
+ if (b != 4 || a != 4)
+ __builtin_abort ();
+}
+
+void
+f4 (void)
+{
+ char a;
+ char b = 1;
+ long long int c = 3LL;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6 || a != 6)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ return 0;
+}