| 1 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -DNO_CROSSCHECK -verify %s |
| 2 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -analyzer-config crosscheck-with-z3=true -verify %s |
| 3 |
// REQUIRES: z3 |
| 4 |
|
| 5 |
typedef struct o p; |
| 6 |
struct o { |
| 7 |
struct { |
| 8 |
} s; |
| 9 |
}; |
| 10 |
|
| 11 |
void q(int *r, int p2) { r < p2; } |
| 12 |
|
| 13 |
void k(int l, int node) { |
| 14 |
struct { |
| 15 |
p *node; |
| 16 |
} * n, *nodep, path[sizeof(void)]; |
| 17 |
path->node = (p*) l; |
| 18 |
for (n = path; node != l;) { |
| 19 |
q((int *)&node, (int)n->node); |
| 20 |
nodep = n; |
| 21 |
} |
| 22 |
if (nodep) // expected-warning {{Branch condition evaluates to a garbage value}} |
| 23 |
n[1].node->s; |
| 24 |
} |