blob: 89f1e8ba793088d9f100e61afa60cd0224091765 [file] [log] [blame]
Kuba Mracek5b576332017-08-15 19:47:06 +00001// RUN: rm -fR %t
2// RUN: mkdir %t
3// RUN: %clang_analyze_cc1 -analyzer-output=html -analyzer-checker=core -o %t %s
4// RUN: ls %t | grep report
Benjamin Kramerf5d46002013-07-05 15:51:00 +00005
Devin Coughlinf0cadcd2017-08-03 18:12:22 +00006// D30406: Test new html-single-file output
Kuba Mracekcea62672017-08-15 19:54:04 +00007// RUN: rm -fR %t
8// RUN: mkdir %t
9// RUN: %clang_analyze_cc1 -analyzer-output=html-single-file -analyzer-checker=core -o %t %s
10// RUN: ls %t | grep report
Devin Coughlinf0cadcd2017-08-03 18:12:22 +000011
Benjamin Kramerf5d46002013-07-05 15:51:00 +000012// PR16547: Test relative paths
Kuba Mracek5b576332017-08-15 19:47:06 +000013// RUN: cd %t
Dominic Chen184c6242017-03-03 18:02:02 +000014// RUN: %clang_analyze_cc1 -analyzer-output=html -analyzer-checker=core -o testrelative %s
Kuba Mracek5b576332017-08-15 19:47:06 +000015// RUN: ls %t/testrelative | grep report
Benjamin Kramerf5d46002013-07-05 15:51:00 +000016
Ted Kremenekf9e9d332012-03-02 01:27:31 +000017// Currently this test mainly checks that the HTML diagnostics doesn't crash
18// when handling macros will calls with macros. We should actually validate
19// the output, but that requires being able to match against a specifically
20// generate HTML file.
21
22#define DEREF(p) *p = 0xDEADBEEF
23
24void has_bug(int *p) {
25 DEREF(p);
26}
27
28#define CALL_HAS_BUG(q) has_bug(q)
29
30void test_call_macro() {
31 CALL_HAS_BUG(0);
32}