25 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -DNO_CROSSCHECK -verify %s2// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -analyzer-config crosscheck-with-z3=true -verify %s3// REQUIRES: z34 5typedef struct o p;6struct o {7 struct {8 } s;9};10 11void q(int *r, int p2) { r < p2; }12 13void 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}25