aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr89796.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/pr89796.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr89796.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/pr89796.c b/gcc/testsuite/gcc.dg/gomp/pr89796.c
new file mode 100644
index 00000000000..14f509311fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr89796.c
@@ -0,0 +1,23 @@
+/* PR c++/89796 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Wunused-value" } */
+
+int
+f1 (int *p)
+{
+ int r;
+ #pragma omp atomic capture /* { dg-bogus "value computed is not used" } */
+ { r = *p; (*p)++; }
+ return r;
+}
+
+int
+f2 (int *p)
+{
+ int s
+ = ({ int r;
+ #pragma omp atomic capture /* { dg-bogus "value computed is not used" } */
+ { r = *p; (*p)++; }
+ r; });
+ return s;
+}