blob: 045943ae8b111f8543bf3c0df6188446d1417350 [file] [log] [blame]
Daniel Dunbar8b576972009-11-08 01:45:36 +00001// RUN: rm -rf %t
Argyrios Kyrtzidis9eb02df2011-02-28 19:49:42 +00002// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
NAKAMURA Takumibf37ee72014-11-04 13:05:10 +00003// RUN: find %t -name "*.html" -exec cat "{}" ";" | FileCheck %s
Daniel Dunbaraef52f42009-11-05 02:11:37 +00004
NAKAMURA Takumi1fb02cb2014-07-16 12:05:45 +00005// REQUIRES: staticanalyzer
6
Daniel Dunbaraef52f42009-11-05 02:11:37 +00007// CHECK: <h3>Annotated Source Code</h3>
Andrew Trick9642cc62010-10-21 03:59:06 +00008
9// Without tweaking expr, the expr would hit to the line below
10// emitted to the output as comment.
11// CHECK: {{[D]ereference of null pointer}}
Daniel Dunbar23bd6cc2008-10-04 20:46:41 +000012
13void f0(int x) {
14 int *p = &x;
15
16 if (x > 10) {
17 if (x == 22)
18 p = 0;
19 }
20
21 *p = 10;
22}
23
24