Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Wbool-operation-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 /* PR c/77490 */ |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-Wall" } */ | |
4 | |
5 int | |
6 fn (_Bool b) | |
7 { | |
8 int r = 0; | |
9 | |
10 r += b++; /* { dg-warning "increment of a boolean expression" } */ | |
11 r += ++b; /* { dg-warning "increment of a boolean expression" } */ | |
12 r += b--; /* { dg-warning "decrement of a boolean expression" } */ | |
13 r += --b; /* { dg-warning "decrement of a boolean expression" } */ | |
14 | |
15 return r; | |
16 } |