xref: /llvm-project/clang/test/Coverage/html-multifile-diagnostics.c (revision 25098736c1b6a716711a64fa45f7f34ccdbef6d1)
1f0cadcd9SDevin Coughlin // RUN: rm -rf %t
2f0cadcd9SDevin Coughlin // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
3f0cadcd9SDevin Coughlin // RUN: find %t -name "*.html" -exec cat "{}" ";" | FileCheck %s
4f0cadcd9SDevin Coughlin 
5f0cadcd9SDevin Coughlin // REQUIRES: staticanalyzer
6f0cadcd9SDevin Coughlin 
7099e4b2aSMalcolm Parsons // CHECK: <!-- FILENAME html-multifile-diagnostics.h -->
8099e4b2aSMalcolm Parsons 
9f0cadcd9SDevin Coughlin // CHECK: <h3>Annotated Source Code</h3>
10f0cadcd9SDevin Coughlin 
11f0cadcd9SDevin Coughlin // Make sure it's generated as multi-file HTML output
12f0cadcd9SDevin Coughlin // CHECK: <h4 class=FileName>{{.*}}html-multifile-diagnostics.c</h4>
13f0cadcd9SDevin Coughlin // CHECK: <h4 class=FileName>{{.*}}html-multifile-diagnostics.h</h4>
14f0cadcd9SDevin Coughlin 
15f0cadcd9SDevin Coughlin // Without tweaking expr, the expr would hit to the line below
16f0cadcd9SDevin Coughlin // emitted to the output as comment.
17f0cadcd9SDevin Coughlin // CHECK: {{[D]ereference of null pointer}}
18f0cadcd9SDevin Coughlin 
19f0cadcd9SDevin Coughlin #include "html-multifile-diagnostics.h"
20f0cadcd9SDevin Coughlin 
f0(void)21*25098736SAaron Ballman void f0(void) {
22f0cadcd9SDevin Coughlin   f1((int*)0);
23f0cadcd9SDevin Coughlin }
24