summaryrefslogtreecommitdiff
path: root/test/Analysis/PR37855.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/PR37855.c')
-rw-r--r--test/Analysis/PR37855.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Analysis/PR37855.c b/test/Analysis/PR37855.c
new file mode 100644
index 0000000000000..0779796531fd6
--- /dev/null
+++ b/test/Analysis/PR37855.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -w -DNO_CROSSCHECK -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -w -analyzer-config crosscheck-with-z3=true -verify %s
+// REQUIRES: z3
+
+typedef struct o p;
+struct o {
+ struct {
+ } s;
+};
+
+void q(*r, p2) { r < p2; }
+
+void k(l, node) {
+ struct {
+ p *node;
+ } * n, *nodep, path[sizeof(void)];
+ path->node = l;
+ for (n = path; node != l;) {
+ q(node, n->node);
+ nodep = n;
+ }
+ if (nodep) // expected-warning {{Branch condition evaluates to a garbage value}}
+ n[1].node->s;
+}