Daniel Dunbar | 23bd6cc | 2008-10-04 20:46:41 | [diff] [blame] | 1 | // RUN: rm -rf %t && |
Daniel Dunbar | aef52f4 | 2009-11-05 02:11:37 | [diff] [blame^] | 2 | // RUN: clang-cc -analyze -analyzer-output=html -checker-cfref -o %t %s && |
3 | // RUN: cat %t/*.html | FileCheck %s | ||||
4 | |||||
5 | // CHECK: <h3>Annotated Source Code</h3> | ||||
6 | // CHECK: Dereference of null pointer | ||||
Daniel Dunbar | 23bd6cc | 2008-10-04 20:46:41 | [diff] [blame] | 7 | |
8 | void f0(int x) { | ||||
9 | int *p = &x; | ||||
10 | |||||
11 | if (x > 10) { | ||||
12 | if (x == 22) | ||||
13 | p = 0; | ||||
14 | } | ||||
15 | |||||
16 | *p = 10; | ||||
17 | } | ||||
18 | |||||
19 |