summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authoryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-11 21:08:09 +0000
committeryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-11 21:08:09 +0000
commit31ff2bcaeb342b9ecd7bda12d30ad83ae7f7c819 (patch)
tree2860bda2c330da87682685781d7c9b62fa3cf81e /libgomp
parent1b505641e26f98cb52fee9ce0a729187d68fb3c4 (diff)
downloadlinaro-gcc-31ff2bcaeb342b9ecd7bda12d30ad83ae7f7c819.tar.gz
linaro-gcc-31ff2bcaeb342b9ecd7bda12d30ad83ae7f7c819.tar.bz2
linaro-gcc-31ff2bcaeb342b9ecd7bda12d30ad83ae7f7c819.zip
Merge branches/gcc-4_9-branch rev 221341
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@221360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog16
-rw-r--r--libgomp/testsuite/libgomp.c++/atomic-16.C5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr64824.C5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr64868.C5
-rw-r--r--libgomp/testsuite/libgomp.c/atomic-18.c61
-rw-r--r--libgomp/testsuite/libgomp.c/pr64824.c16
-rw-r--r--libgomp/testsuite/libgomp.c/pr64868.c87
7 files changed, 195 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 81c62da380b..c1a983a5094 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,19 @@
+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>
+
+ PR c/64824
+ PR c/64868
+ * testsuite/libgomp.c/pr64824.c: New test.
+ * testsuite/libgomp.c/pr64868.c: New test.
+ * testsuite/libgomp.c++/pr64824.C: New test.
+ * testsuite/libgomp.c++/pr64868.C: New test.
+
2015-01-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64734
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++/pr64824.C b/libgomp/testsuite/libgomp.c++/pr64824.C
new file mode 100644
index 00000000000..348f6d6e0c2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr64824.C
@@ -0,0 +1,5 @@
+// PR c/64824
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/pr64824.c"
diff --git a/libgomp/testsuite/libgomp.c++/pr64868.C b/libgomp/testsuite/libgomp.c++/pr64868.C
new file mode 100644
index 00000000000..2d730ac4924
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr64868.C
@@ -0,0 +1,5 @@
+// PR c/64868
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/pr64868.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;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr64824.c b/libgomp/testsuite/libgomp.c/pr64824.c
new file mode 100644
index 00000000000..544d0b0fc1f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64824.c
@@ -0,0 +1,16 @@
+/* PR c/64824 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+int
+main ()
+{
+ long long a;
+ long long b = 1LL;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6LL || a != 6LL)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr64868.c b/libgomp/testsuite/libgomp.c/pr64868.c
new file mode 100644
index 00000000000..acdf9984108
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64868.c
@@ -0,0 +1,87 @@
+/* PR c/64868 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+float f = 2.0f;
+double d = 4.0;
+long double ld = 8.0L;
+
+void
+foo ()
+{
+#pragma omp atomic
+ f = 1.0f / f;
+#pragma omp atomic
+ f = 1 / f;
+#pragma omp atomic
+ f = f / 2.0f;
+#pragma omp atomic
+ f = f / 2;
+#pragma omp atomic
+ f /= 2.0f;
+#pragma omp atomic
+ f /= 2;
+#pragma omp atomic
+ d = 1.0 / d;
+#pragma omp atomic
+ d = 1 / d;
+#pragma omp atomic
+ d = d / 2.0;
+#pragma omp atomic
+ d = d / 2;
+#pragma omp atomic
+ d /= 2.0;
+#pragma omp atomic
+ d /= 2;
+#pragma omp atomic
+ ld = 1.0L / ld;
+#pragma omp atomic
+ ld = 1 / ld;
+#pragma omp atomic
+ ld = ld / 2.0L;
+#pragma omp atomic
+ ld = ld / 2;
+#pragma omp atomic
+ ld /= 2.0L;
+#pragma omp atomic
+ ld /= 2;
+ if (f != 0.125f || d != 0.25 || ld != 0.5L)
+ __builtin_abort ();
+}
+
+#ifdef __cplusplus
+template <typename T, int N1, int N2>
+void
+bar ()
+{
+ T v = ::d;
+#pragma omp atomic
+ v *= 16;
+#pragma omp atomic
+ v = 1.0 / v;
+#pragma omp atomic
+ v = N1 / v;
+#pragma omp atomic
+ v = v / 2.0;
+#pragma omp atomic
+ v = v / N2;
+#pragma omp atomic
+ v /= 2.0;
+#pragma omp atomic
+ v /= N2;
+ if (v != 0.25)
+ __builtin_abort ();
+}
+#endif
+
+int
+main ()
+{
+ foo ();
+#ifdef __cplusplus
+ bar<float, 1, 2> ();
+ bar<double, 1, 2> ();
+ bar<long double, 1, 2> ();
+#endif
+ return 0;
+}