simplify '(x / -1)' to '-x' (but only for signed division)
[smatch.git] / validation / c99-for-loop.c
blob42246c513294fd70cb0698e2b2462756d025abb3
1 int op(int);
3 static int good(void)
5 __context__(1);
6 for (int i = 0; i < 10; i++) {
7 if (!op(i)) {
8 __context__(-1);
9 return 0;
12 __context__(-1);
13 return 1;
16 static int bad(void)
18 __context__(1);
19 for (int i = 0; i < 10; i++) {
20 if (!op(i)) {
21 __context__(-1);
22 return 0;
25 return 1;
28 * check-name: C99 for loop variable declaration
30 * check-error-start
31 c99-for-loop.c:16:12: warning: context imbalance in 'bad' - different lock contexts for basic block
32 * check-error-end