[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / plist-html-macros.c
blobaf80fac9f6d437f3d536680dbbe03192459d0efe
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // (basic correctness check)
4 // RUN: rm -rf %t.dir
5 // RUN: mkdir -p %t.dir
6 //
7 // RUN: %clang_analyze_cc1 -o %t.dir/index.plist %s \
8 // RUN: -analyzer-checker=core -analyzer-output=plist-html
9 //
10 // RUN: ls %t.dir | grep '\.html' | count 1
11 // RUN: grep '\.html' %t.dir/index.plist | count 1
13 // This tests two things: that the two calls to null_deref below are coalesced
14 // into a single bug by both the plist and HTML diagnostics, and that the plist
15 // diagnostics have a reference to the HTML diagnostics. (It would be nice to
16 // check more carefully that the two actually match, but that's hard to write
17 // in a lit RUN line.)
19 #define CALL_FN(a) null_deref(a)
21 void null_deref(int *a) {
22 if (a)
23 return;
24 *a = 1; // expected-warning{{null}}
27 void test1(void) {
28 CALL_FN(0);
31 void test2(int *p) {
32 CALL_FN(p);