C: Add test for incorrect warning for assignment of certain volatile expressions fixed by commit 58a45ce
[PR98029]
2021-01-04 Martin Uecker <muecker@gwdg.de> gcc/testsuite/ PR c/98029 * gcc.dg/pr98029.c: New test.
This commit is contained in:
parent
f262a35188
commit
a000eb5918
1 changed files with 21 additions and 0 deletions
21
gcc/testsuite/gcc.dg/pr98029.c
Normal file
21
gcc/testsuite/gcc.dg/pr98029.c
Normal file
|
@ -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;
|
||||
}
|
Loading…
Add table
Reference in a new issue