1 // RUN: rm -rf %t && mkdir -p %t
2 // RUN: cp -r %S/Inputs/header-search-pruning/* %t
3 // RUN: cp %S/header-search-pruning.cpp %t/header-search-pruning.cpp
4 // RUN: sed -e "s|DIR|%/t|g" -e "s|DEFINES|-DINCLUDE_A|g" %S/Inputs/header-search-pruning/cdb.json > %t/cdb_a.json
5 // RUN: sed -e "s|DIR|%/t|g" -e "s|DEFINES|-DINCLUDE_B|g" %S/Inputs/header-search-pruning/cdb.json > %t/cdb_b.json
6 // RUN: sed -e "s|DIR|%/t|g" -e "s|DEFINES|-DINCLUDE_A -DINCLUDE_B|g" %S/Inputs/header-search-pruning/cdb.json > %t/cdb_ab.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb_a.json -format experimental-full -optimize-args=header-search >> %t/result_a.json
9 // RUN: cat %t/result_a.json | sed 's:\\\\\?:/:g' | FileCheck --check-prefixes=CHECK_A %s
11 // RUN: clang-scan-deps -compilation-database %t/cdb_b.json -format experimental-full -optimize-args=header-search >> %t/result_b.json
12 // RUN: cat %t/result_b.json | sed 's:\\\\\?:/:g' | FileCheck --check-prefixes=CHECK_B %s
14 // RUN: clang-scan-deps -compilation-database %t/cdb_ab.json -format experimental-full -optimize-args=header-search >> %t/result_ab.json
15 // RUN: cat %t/result_ab.json | sed 's:\\\\\?:/:g' | FileCheck --check-prefixes=CHECK_AB %s
20 // CHECK_A-NEXT: "modules": [
22 // CHECK_A-NEXT: "clang-module-deps": [],
23 // CHECK_A-NEXT: "clang-modulemap-file": "{{.*}}",
24 // CHECK_A-NEXT: "command-line": [
25 // CHECK_A-NEXT: "-cc1"
27 // CHECK_A-NEXT: "begin",
28 // CHECK_A-NEXT: "-I",
30 // CHECK_A-NEXT: "-I",
31 // CHECK_A-NEXT: "end"
33 // CHECK_A-NEXT: "context-hash": "{{.*}}",
34 // CHECK_A-NEXT: "file-deps": [
36 // CHECK_A-NEXT: "link-libraries": [],
37 // CHECK_A-NEXT: "name": "mod"
43 // CHECK_B-NEXT: "modules": [
45 // CHECK_B-NEXT: "clang-module-deps": [],
46 // CHECK_B-NEXT: "clang-modulemap-file": "{{.*}}",
47 // CHECK_B-NEXT: "command-line": [
48 // CHECK_B-NEXT: "-cc1"
50 // CHECK_B-NEXT: "begin",
51 // CHECK_B-NEXT: "-I",
53 // CHECK_B-NEXT: "-I",
54 // CHECK_B-NEXT: "end"
56 // CHECK_B-NEXT: "context-hash": "{{.*}}",
57 // CHECK_B-NEXT: "file-deps": [
59 // CHECK_B-NEXT: "link-libraries": [],
60 // CHECK_B-NEXT: "name": "mod"
66 // CHECK_AB-NEXT: "modules": [
68 // CHECK_AB-NEXT: "clang-module-deps": [],
69 // CHECK_AB-NEXT: "clang-modulemap-file": "{{.*}}",
70 // CHECK_AB-NEXT: "command-line": [
71 // CHECK_AB-NEXT: "-cc1"
73 // CHECK_AB-NEXT: "begin",
74 // CHECK_AB-NEXT: "-I",
75 // CHECK_AB-NEXT: "a",
76 // CHECK_AB-NEXT: "-I",
77 // CHECK_AB-NEXT: "b",
78 // CHECK_AB-NEXT: "-I",
79 // CHECK_AB-NEXT: "end"
81 // CHECK_AB-NEXT: "context-hash": "{{.*}}",
82 // CHECK_AB-NEXT: "file-deps": [
84 // CHECK_AB-NEXT: "link-libraries": [],
85 // CHECK_AB-NEXT: "name": "mod"