Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s
      2 
      3 void clang_analyzer_eval(int);
      4 
      5 void f(void) {
      6   void (*p)(void);
      7   p = f;
      8   p = &f;
      9   p();
     10   (*p)();
     11 }
     12 
     13 void g(void (*fp)(void));
     14 
     15 void f2() {
     16   g(f);
     17 }
     18 
     19 void f3(void (*f)(void), void (*g)(void)) {
     20   clang_analyzer_eval(!f); // expected-warning{{UNKNOWN}}
     21   f();
     22   clang_analyzer_eval(!f); // expected-warning{{FALSE}}
     23 
     24   clang_analyzer_eval(!g); // expected-warning{{UNKNOWN}}
     25   (*g)();
     26   clang_analyzer_eval(!g); // expected-warning{{FALSE}}
     27 }
     28