xref: /minix3/external/bsd/llvm/dist/clang/test/Coverage/html-diagnostics.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: rm -rf %t
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
3*f4a2713aSLionel Sambuc // RUN: cat %t/*.html | FileCheck %s
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc // Because of the glob (*.html)
6*f4a2713aSLionel Sambuc // REQUIRES: shell
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // CHECK: <h3>Annotated Source Code</h3>
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // Without tweaking expr, the expr would hit to the line below
11*f4a2713aSLionel Sambuc // emitted to the output as comment.
12*f4a2713aSLionel Sambuc // CHECK: {{[D]ereference of null pointer}}
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc void f0(int x) {
15*f4a2713aSLionel Sambuc   int *p = &x;
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc   if (x > 10) {
18*f4a2713aSLionel Sambuc     if (x == 22)
19*f4a2713aSLionel Sambuc       p = 0;
20*f4a2713aSLionel Sambuc   }
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc   *p = 10;
23*f4a2713aSLionel Sambuc }
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc 
26