Richard Smith | afa874d | 2012-12-05 06:16:54 +0000 | [diff] [blame] | 1 | // RUN: rm -fR %T/dir |
Richard Smith | 43b550f | 2012-08-17 04:05:25 +0000 | [diff] [blame] | 2 | // RUN: mkdir %T/dir |
| 3 | // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s |
Benjamin Kramer | f5d4600 | 2013-07-05 15:51:00 +0000 | [diff] [blame^] | 4 | // RUN: ls %T/dir | grep report |
| 5 | |
| 6 | // PR16547: Test relative paths |
| 7 | // RUN: cd %T/dir |
| 8 | // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s |
| 9 | // RUN: ls %T/dir/testrelative | grep report |
| 10 | |
| 11 | // REQUIRES: shell |
Ted Kremenek | f9e9d33 | 2012-03-02 01:27:31 +0000 | [diff] [blame] | 12 | |
| 13 | // Currently this test mainly checks that the HTML diagnostics doesn't crash |
| 14 | // when handling macros will calls with macros. We should actually validate |
| 15 | // the output, but that requires being able to match against a specifically |
| 16 | // generate HTML file. |
| 17 | |
| 18 | #define DEREF(p) *p = 0xDEADBEEF |
| 19 | |
| 20 | void has_bug(int *p) { |
| 21 | DEREF(p); |
| 22 | } |
| 23 | |
| 24 | #define CALL_HAS_BUG(q) has_bug(q) |
| 25 | |
| 26 | void test_call_macro() { |
| 27 | CALL_HAS_BUG(0); |
| 28 | } |