1 // RUN: rm -rf %t 2 // RUN: split-file %s %t 3 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json 4 5 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format make -j 1 > %t/result.txt 6 // RUN: FileCheck %s -input-file=%t/result.txt 7 8 // CHECK: {{/|\\}}dir1{{/|\\}}t1.c 9 // CHECK: {{/|\\}}dir1{{/|\\}}head.h 10 // CHECK: {{/|\\}}dir2{{/|\\}}t2.c 11 // CHECK: {{/|\\}}dir2{{/|\\}}head.h 12 13 //--- cdb.json.template 14 [ 15 { 16 "directory": "DIR/dir1", 17 "command": "clang -fsyntax-only t1.c", 18 "file": "t1.c" 19 }, 20 { 21 "directory": "DIR/dir2", 22 "command": "clang -fsyntax-only t2.c", 23 "file": "t2.c" 24 } 25 ] 26 27 //--- dir1/t1.c 28 #include "head.h" 29 30 //--- dir1/head.h 31 #ifndef BBB 32 #define BBB 33 #endif 34 35 //--- dir2/t2.c 36 #include "head.h" 37 38 //--- dir2/head.h 39