1 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core -analyzer-config exploration_strategy=unexplored_first -analyzer-output=text -verify %s
2 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core -analyzer-config exploration_strategy=unexplored_first_queue -analyzer-output=text -verify %s
7 int *x
= 0; // expected-note {{'x' initialized to a null pointer value}}
8 while (coin()) { // expected-note{{Loop condition is true}}
9 if (coin()) // expected-note {{Taking true branch}}
10 // expected-note@-1 {{Assuming the condition is true}}
11 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
12 // expected-note@-1{{Dereference of null pointer (loaded from variable 'x')}}
24 int *x
= 0; // expected-note {{'x' initialized to a null pointer value}}
25 while (coin()) { // expected-note{{Loop condition is true}}
26 if (coin()) // expected-note {{Taking false branch}}
27 // expected-note@-1 {{Assuming the condition is false}}
30 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
31 // expected-note@-1{{Dereference of null pointer (loaded from variable 'x')}}
37 while(coin()) // expected-note{{Loop condition is true}}
38 if (coin()) // expected-note {{Assuming the condition is false}}
39 // expected-note@-1 {{Taking false branch}}
42 foo(); // expected-note{{Calling 'foo'}}