Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Argyrios Kyrtzidis | c4d2c90 | 2011-02-28 19:49:42 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s |
Andrew Trick | 85c7eac | 2010-10-20 23:52:37 +0000 | [diff] [blame] | 3 | // RUN: cat %t/*.html | FileCheck %s |
Daniel Dunbar | ad451cc | 2009-11-05 02:11:37 +0000 | [diff] [blame] | 4 | |
| 5 | // CHECK: <h3>Annotated Source Code</h3> |
Andrew Trick | a366642 | 2010-10-21 03:59:06 +0000 | [diff] [blame] | 6 | |
| 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 Dunbar | ae3c16c | 2008-10-04 20:46:41 +0000 | [diff] [blame] | 10 | |
| 11 | void 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 | |