gcc/testsuite/gcc.dg/analyzer/data-model-7.c
raw| 1 | /* { dg-additional-options "-fno-analyzer-state-merge" } */ |
| 2 | #include "analyzer-decls.h" |
| 3 | |
| 4 | int test_40 (int flag) |
| 5 | { |
| 6 | int i; |
| 7 | if (flag) |
| 8 | i = 43; |
| 9 | else |
| 10 | i = 17; |
| 11 | |
| 12 | /* Without state-merging, we retain the relationship between 'flag' and 'i'. */ |
| 13 | __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 processed enodes" } */ |
| 14 | |
| 15 | if (flag) |
| 16 | __analyzer_eval (i == 43); /* { dg-warning "TRUE" } */ |
| 17 | else |
| 18 | __analyzer_eval (i == 17); /* { dg-warning "TRUE" } */ |
| 19 | } |