blob: be820fb90f29b7df7e3b54df48868b2f2ae6c1a7 [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: rm -rf %t
Ted Kremenek565e4652010-02-05 02:06:54 +00002// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-check-objc-mem -o %t %s
Andrew Trick85c7eac2010-10-20 23:52:37 +00003// RUN: cat %t/*.html | FileCheck %s
Daniel Dunbarad451cc2009-11-05 02:11:37 +00004
5// CHECK: <h3>Annotated Source Code</h3>
Andrew Tricka3666422010-10-21 03:59:06 +00006
7// Without tweaking expr, the expr would hit to the line below
8// emitted to the output as comment.
9// CHECK: {{[D]ereference of null pointer}}
Daniel Dunbarae3c16c2008-10-04 20:46:41 +000010
11void f0(int x) {
12 int *p = &x;
13
14 if (x > 10) {
15 if (x == 22)
16 p = 0;
17 }
18
19 *p = 10;
20}
21
22