1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
4 int *p
= (int *)sizeof(int);
6 return *p
; // expected-warning {{Dereference of null pointer}}
10 int *p
= (int *)sizeof(int);
13 return *p
; // expected-warning {{Dereference of null pointer}}
17 int *p
= (int *)sizeof(int);
21 return *p
; // expected-warning {{Dereference of null pointer}}
25 // This is a special case where pointer arithmetic is not calculated to
26 // preserve useful warnings on dereferences of null pointers.
29 return *p
; // expected-warning {{Dereference of null pointer}}