aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/do-empty.c
blob: 350261d48ed831fc5b5189fa6424bc3bbf18c6ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Test diagnostics for empty bodies in do / while.  */
/* { dg-do compile } */
/* { dg-options "-Wempty-body" } */

void
f (int x)
{
  do
    ; /* { dg-warning "empty body in" } */
  while (x--);

  do
  {} /* { dg-bogus "empty body in" } */
  while (++x < 10);
}