xref: /llvm-project/clang/test/Coverage/html-diagnostics.c (revision 1fb02cb62ea12bea47580dd1f00301658b583db6)
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
3 // RUN: cat %t/*.html | FileCheck %s
4 
5 // REQUIRES: staticanalyzer
6 
7 // Because of the glob (*.html)
8 // REQUIRES: shell
9 
10 // CHECK: <h3>Annotated Source Code</h3>
11 
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}}
15 
16 void 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 
28