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