blob: c7489f82dd7ce5dc26f6588eb5ca766b603a549e [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
Andrew Trick8cdb3f72010-10-20 23:52:37 +00003// RUN: cat %t/*.html | FileCheck %s
Daniel Dunbaraef52f42009-11-05 02:11:37 +00004
NAKAMURA Takumi1fb02cb2014-07-16 12:05:45 +00005// REQUIRES: staticanalyzer
6
Alp Tokerdbb846a2013-10-25 22:30:07 +00007// Because of the glob (*.html)
8// REQUIRES: shell
9
Daniel Dunbaraef52f42009-11-05 02:11:37 +000010// CHECK: <h3>Annotated Source Code</h3>
Andrew Trick9642cc62010-10-21 03:59:06 +000011
12// Without tweaking expr, the expr would hit to the line below
13// emitted to the output as comment.
14// CHECK: {{[D]ereference of null pointer}}
Daniel Dunbar23bd6cc2008-10-04 20:46:41 +000015
16void f0(int x) {
17 int *p = &x;
18
19 if (x > 10) {
20 if (x == 22)
21 p = 0;
22 }
23
24 *p = 10;
25}
26
27