2009-11-18 14:59:57 +00:00
|
|
|
// RUN: rm -rf %t
|
2011-05-02 19:39:53 +00:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
|
2009-11-05 17:18:09 +00:00
|
|
|
// RUN: cat %t/*.html | FileCheck %s
|
|
|
|
|
2014-11-24 09:15:30 +00:00
|
|
|
// REQUIRES: staticanalyzer
|
|
|
|
|
2013-12-22 00:07:40 +00:00
|
|
|
// Because of the glob (*.html)
|
|
|
|
// REQUIRES: shell
|
|
|
|
|
2009-11-05 17:18:09 +00:00
|
|
|
// CHECK: <h3>Annotated Source Code</h3>
|
2011-02-20 13:06:31 +00:00
|
|
|
|
|
|
|
// Without tweaking expr, the expr would hit to the line below
|
|
|
|
// emitted to the output as comment.
|
|
|
|
// CHECK: {{[D]ereference of null pointer}}
|
2009-06-02 17:58:47 +00:00
|
|
|
|
|
|
|
void f0(int x) {
|
|
|
|
int *p = &x;
|
|
|
|
|
|
|
|
if (x > 10) {
|
|
|
|
if (x == 22)
|
|
|
|
p = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
|