blob: 4f1b0e3763b8d55cc9a8108ca4f04f1f031b3f7a [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: rm -rf %t
Argyrios Kyrtzidisc4d2c902011-02-28 19:49:42 +00002// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -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