1 // RUN: %clang_cc1 -w -fblocks -analyze -analyzer-checker=core,deadcode,alpha.core,debug.ExprInspection -verify %s
3 void *malloc(unsigned long);
4 void clang_analyzer_warnIfReached(void);
6 void test_static_from_block(void) {
13 void test_static_within_block(void) {
16 *x; // expected-warning{{Dereference of null pointer}}
20 void test_static_control_flow(int y) {
23 // FIXME: Should be reachable.
24 clang_analyzer_warnIfReached(); // no-warning
27 // We are not sure if this branch is possible, because the developer
28 // may argue that function is always called with y == 1 for the first time.
29 // In this case, we can only advise the developer to add assertions
30 // for suppressing such path.
31 *x; // expected-warning{{Dereference of null pointer}}