1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // (basic correctness check)
5 // RUN: mkdir -p %t.dir
7 // RUN: %clang_analyze_cc1 -o %t.dir/index.plist %s \
8 // RUN: -analyzer-checker=core -analyzer-output=plist-html
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
) {
24 *a
= 1; // expected-warning{{null}}