blob: 75612931710164efa399807483725395d3623785 [file] [log] [blame]
Ted Kremenekb8e26e62008-06-19 17:55:38 +00001// RUN: clang -checker-simple -verify %s
2
3#include <stdlib.h>
4
5int f1(int * p) {
6
7 // This branch should be infeasible
8 // because __imag__ p is 0.
9 if (!p && __imag__ (intptr_t) p)
10 *p = 1; // no-warning
11
12 // If p != 0 then this branch is feasible; otherwise it is not.
13 if (__real__ (intptr_t) p)
14 *p = 1; // no-warning
15
16 *p = 2; // expected-warning{{Dereference of null pointer}}
17}