Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core -verify %s
      2 
      3 // For now, don't inline varargs.
      4 void foo(int *x, ...) {
      5   *x = 1;
      6 }
      7 
      8 void bar() {
      9   foo(0, 2); // no-warning
     10 }
     11 
     12 // For now, don't inline vararg blocks.
     13 void (^baz)(int *x, ...) = ^(int *x, ...) { *x = 1; };
     14 
     15 void taz() {
     16   baz(0, 2); // no-warning
     17 }
     18 
     19 // For now, don't inline global blocks.
     20 void (^qux)(int *p) = ^(int *p) { *p = 1; };
     21 void test_qux() {
     22   qux(0); // no-warning
     23 }
     24 
     25 
     26 void test_analyzer_is_running() {
     27   int *p = 0;
     28   *p = 0xDEADBEEF; // expected-warning {{null}}
     29 }
     30