• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: rm -fR %T/dir
2 // RUN: mkdir %T/dir
3 // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s
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 // Currently this test mainly checks that the HTML diagnostics doesn't crash
12 // when handling macros will calls with macros.  We should actually validate
13 // the output, but that requires being able to match against a specifically
14 // generate HTML file.
15 
16 #define DEREF(p) *p = 0xDEADBEEF
17 
has_bug(int * p)18 void has_bug(int *p) {
19   DEREF(p);
20 }
21 
22 #define CALL_HAS_BUG(q) has_bug(q)
23 
test_call_macro()24 void test_call_macro() {
25   CALL_HAS_BUG(0);
26 }
27