blob: be337edab11adfd0228f0ef6a675ed92b069ea00 [file] [log] [blame]
Anna Zaks2b687612013-02-07 23:05:37 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s
2
3void clang_analyzer_eval(int);
4
5void use(int);
6id foo(int x) {
7 if (x)
8 return 0;
9 static id p = foo(1);
10 clang_analyzer_eval(p == 0); // expected-warning{{TRUE}}
11 return p;
Jordan Rosefbdbed32013-02-25 19:45:34 +000012}
13
14const int &globalInt = 42;
15
16void testGlobal() {
17 // FIXME: Should be TRUE, but should at least not crash.
18 clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}}
19}