Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / feasibility-pr107948.c
blob5eb8b0aef228ac8a8c022148b45540f1da629ce6
1 #include "analyzer-decls.h"
3 void foo(int width) {
4 int i = 0;
5 int base;
6 if (width > 0){
7 __analyzer_eval(i == 0); /* { dg-warning "TRUE" } */
8 __analyzer_eval(width > 0); /* { dg-warning "TRUE" } */
9 __analyzer_eval(width - i > 0); /* { dg-warning "TRUE" } */
10 __analyzer_eval(i - width <= 0); /* { dg-warning "TRUE" } */
11 if (i - width <= 0) {
12 base = 512;
14 else {
15 __analyzer_dump_path (); /* { dg-bogus "path" } */
17 base+=1; /* { dg-bogus "uninit" } */
21 void test_ge_zero (int x)
23 if (x >= 0)
25 __analyzer_eval(x >= 0); /* { dg-warning "TRUE" } */
26 __analyzer_eval(x > 0); /* { dg-warning "UNKNOWN" } */
27 __analyzer_eval(x <= 0); /* { dg-warning "UNKNOWN" } */
28 __analyzer_eval(x < 0); /* { dg-warning "FALSE" } */
29 __analyzer_eval(-x <= 0); /* { dg-warning "TRUE" } */
30 __analyzer_eval(-x < 0); /* { dg-warning "UNKNOWN" } */
31 __analyzer_eval(-x >= 0); /* { dg-warning "UNKNOWN" } */
32 __analyzer_eval(-x > 0); /* { dg-warning "FALSE" } */
36 void test_gt_zero (int x)
38 if (x > 0)
40 __analyzer_eval(x >= 0); /* { dg-warning "TRUE" } */
41 __analyzer_eval(x > 0); /* { dg-warning "TRUE" } */
42 __analyzer_eval(x <= 0); /* { dg-warning "FALSE" } */
43 __analyzer_eval(x < 0); /* { dg-warning "FALSE" } */
44 __analyzer_eval(-x <= 0); /* { dg-warning "TRUE" } */
45 __analyzer_eval(-x < 0); /* { dg-warning "TRUE" } */
46 __analyzer_eval(-x >= 0); /* { dg-warning "FALSE" } */
47 __analyzer_eval(-x > 0); /* { dg-warning "FALSE" } */