1 // RUN: rm -rf %t.dir 2 // RUN: rm -rf %t.cdb 3 // RUN: rm -rf %t_clangcl.cdb 4 // RUN: mkdir -p %t.dir 5 // RUN: cp %s %t.dir/regular_cdb_input.cpp 6 // RUN: cp %s %t.dir/regular_cdb_input2.cpp 7 // RUN: mkdir %t.dir/Inputs 8 // RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h 9 // RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h 10 // RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb 11 // RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb 12 // 13 // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-dependency-directives | \ 14 // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s 15 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-dependency-directives | \ 16 // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s 17 18 // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \ 19 // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s 20 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess | \ 21 // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s 22 23 // Make sure we didn't produce any dependency files! 24 // RUN: not cat %t.dir/regular_cdb.d 25 // RUN: not cat %t.dir/regular_cdb_clangcl.d 26 // RUN: not cat %t.dir/regular_cdb2.d 27 // RUN: not cat %t.dir/regular_cdb2_clangcl.d 28 // 29 // The output order is non-deterministic when using more than one thread, 30 // so check the output using two runs. Note that the 'NOT' check is not used 31 // as it might fail if the results for `regular_cdb_input.cpp` are reported before 32 // `regular_cdb_input2.cpp`. 33 // 34 // RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \ 35 // RUN: FileCheck --check-prefix=CHECK1 %s 36 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \ 37 // RUN: FileCheck --check-prefix=CHECK1 %s 38 39 // RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \ 40 // RUN: FileCheck --check-prefix=CHECK1 %s 41 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \ 42 // RUN: FileCheck --check-prefix=CHECK1 %s 43 44 // RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \ 45 // RUN: FileCheck --check-prefix=CHECK2 %s 46 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \ 47 // RUN: FileCheck --check-prefix=CHECK2 %s 48 49 // RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \ 50 // RUN: FileCheck --check-prefix=CHECK2 %s 51 // RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \ 52 // RUN: FileCheck --check-prefix=CHECK2 %s 53 54 #include "header.h" 55 56 // CHECK1: regular_cdb_input2.o: 57 // CHECK1-NEXT: regular_cdb_input2.cpp 58 // CHECK1-NEXT: Inputs{{/|\\}}header.h 59 // CHECK1-NEXT: Inputs{{/|\\}}header2.h 60 61 // CHECK2: regular_cdb_input.o: 62 // CHECK2-NEXT: regular_cdb_input.cpp 63 // CHECK2-NEXT: Inputs{{/|\\}}header.h 64 // CHECK2NO-NOT: header2 65 66 // CHECK3: adena.o: 67