Daniel Dunbar | 8b57697 | 2009-11-08 01:45:36 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Argyrios Kyrtzidis | 9eb02df | 2011-02-28 19:49:42 | [diff] [blame] | 2 | // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s |
Andrew Trick | 8cdb3f7 | 2010-10-20 23:52:37 | [diff] [blame] | 3 | // RUN: cat %t/*.html | FileCheck %s |
Daniel Dunbar | aef52f4 | 2009-11-05 02:11:37 | [diff] [blame] | 4 | |
| 5 | // CHECK: <h3>Annotated Source Code</h3> |
Andrew Trick | 9642cc6 | 2010-10-21 03:59:06 | [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 | 23bd6cc | 2008-10-04 20:46:41 | [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 | |