Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s
      2 
      3 void clang_analyzer_eval(int);
      4 
      5 void use(int);
      6 id 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;
     12 }
     13 
     14 const int &globalInt = 42;
     15 
     16 void testGlobal() {
     17   // FIXME: Should be TRUE, but should at least not crash.
     18   clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}}
     19 }
     20