Kuba Mracek | 5b57633 | 2017-08-15 19:47:06 +0000 | [diff] [blame] | 1 | // 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 Kramer | f5d4600 | 2013-07-05 15:51:00 +0000 | [diff] [blame] | 5 | |
Devin Coughlin | f0cadcd | 2017-08-03 18:12:22 +0000 | [diff] [blame] | 6 | // D30406: Test new html-single-file output |
Kuba Mracek | cea6267 | 2017-08-15 19:54:04 +0000 | [diff] [blame] | 7 | // 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 Coughlin | f0cadcd | 2017-08-03 18:12:22 +0000 | [diff] [blame] | 11 | |
Benjamin Kramer | f5d4600 | 2013-07-05 15:51:00 +0000 | [diff] [blame] | 12 | // PR16547: Test relative paths |
Kuba Mracek | 5b57633 | 2017-08-15 19:47:06 +0000 | [diff] [blame] | 13 | // RUN: cd %t |
Dominic Chen | 184c624 | 2017-03-03 18:02:02 +0000 | [diff] [blame] | 14 | // RUN: %clang_analyze_cc1 -analyzer-output=html -analyzer-checker=core -o testrelative %s |
Kuba Mracek | 5b57633 | 2017-08-15 19:47:06 +0000 | [diff] [blame] | 15 | // RUN: ls %t/testrelative | grep report |
Benjamin Kramer | f5d4600 | 2013-07-05 15:51:00 +0000 | [diff] [blame] | 16 | |
Ted Kremenek | f9e9d33 | 2012-03-02 01:27:31 +0000 | [diff] [blame] | 17 | // 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 | |
| 24 | void has_bug(int *p) { |
| 25 | DEREF(p); |
| 26 | } |
| 27 | |
| 28 | #define CALL_HAS_BUG(q) has_bug(q) |
| 29 | |
| 30 | void test_call_macro() { |
| 31 | CALL_HAS_BUG(0); |
| 32 | } |