]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/pr59871.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr59871.c
CommitLineData
789eadcd
MP
1/* PR c/59871 */
2/* { dg-do compile } */
3/* { dg-options "-Wunused" } */
4
5extern int bar ();
6
7void
8foo (int *p, int i)
9{
10 p[0] = (bar (), 1, bar ()); /* { dg-warning "right-hand operand of comma expression has no effect" } */
11 p[1] = (1, bar ()); /* { dg-warning "left-hand operand of comma expression has no effect" } */
12 bar (), 1, bar (); /* { dg-warning "right-hand operand of comma expression has no effect" } */
13 bar (), 1; /* { dg-warning "right-hand operand of comma expression has no effect" } */
14 1, bar (); /* { dg-warning "left-hand operand of comma expression has no effect" } */
15 (bar (), 1); /* { dg-warning "right-hand operand of comma expression has no effect" } */
16 bar (), 5 * i; /* { dg-warning "right-hand operand of comma expression has no effect" } */
17 (bar (), 5 * i); /* { dg-warning "right-hand operand of comma expression has no effect" } */
18 (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7))))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
19 bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7)))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
20 bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ())))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
21 (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ()))))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
22}