aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/pr98029.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr98029.c b/gcc/testsuite/gcc.dg/pr98029.c
new file mode 100644
index 0000000..148f23c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr98029.c
@@ -0,0 +1,21 @@
+/* pr98029 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+double f2 (void)
+{
+ volatile double d;
+ int i;
+
+ for (d = 2.0, i = 0; i < 5; i++, d *= d) /* { dg-bogus "right-hand operand of comma expression has no effect" } */
+ ;
+
+ return d;
+}
+
+int g(void)
+{
+ volatile int x;
+ (x = 1, (void)1); /* { dg-bogus "right-hand operand of comma expression has no effect" } */
+ return x;
+}