Skip to content

Commit df09cb2

Browse files
authored
Test config macro canonicalization with CAS. (#11454)
This is a test accompanying llvm#159620, which fixes config macro canonicalization for scanning. Specifically, without llvm#159620, when CAS is on, there are three variants of A. With llvm#159620, there should be only two variants. Part of work for rdar://136303612
1 parent aadb4b1 commit df09cb2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

clang/test/ClangScanDeps/optimize-canonicalize-macros.m

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
// RUN: clang-scan-deps -compilation-database %t/build/compile-commands.json \
88
// RUN: -j 1 -format experimental-full -optimize-args=canonicalize-macros > %t/deps.db
99
// RUN: cat %t/deps.db | FileCheck %s -DPREFIX=%/t
10+
// RUN: clang-scan-deps -compilation-database %t/build/compile-commands.json \
11+
// RUN: -j 1 -format experimental-include-tree-full -cas-path %t/cas \
12+
// RUN: -optimize-args=canonicalize-macros > %t/deps_cas.db
13+
// RUN: cat %t/deps_cas.db | FileCheck %s --check-prefixes=CAS
1014

1115
// This tests that we have two scanning module variants.
1216
// RUN: find %t/module-cache -name "*.pcm" | wc -l | grep 2
@@ -51,6 +55,41 @@
5155
// CHECK: }
5256

5357

58+
// Check that when CAS is on, we still only have two variants of A.
59+
// CAS: {
60+
// CAS-NEXT: "modules": [
61+
// CAS-NEXT: {
62+
// CAS-NEXT: "cache-key": "{{.*}}",
63+
// CAS-NEXT: "cas-include-tree-id": "{{.*}}",
64+
// CAS-NEXT: "clang-module-deps": [],
65+
// CAS-NEXT: "clang-modulemap-file":
66+
// CAS-NEXT: "command-line": [
67+
// CAS: ],
68+
// CAS-NEXT: "context-hash": "{{.*}}",
69+
// CAS-NEXT: "file-deps": [
70+
// CAS: ],
71+
// CAS-NEXT: "link-libraries": [],
72+
// CAS-NEXT: "name": "A"
73+
// CAS-NEXT: },
74+
// CAS-NEXT: {
75+
// CAS-NEXT: "cache-key": "{{.*}}",
76+
// CAS-NEXT: "cas-include-tree-id": "{{.*}}",
77+
// CAS-NEXT: "clang-module-deps": [],
78+
// CAS-NEXT: "clang-modulemap-file":
79+
// CAS-NEXT: "command-line": [
80+
// CAS: ],
81+
// CAS-NEXT: "context-hash": "{{.*}}",
82+
// CAS-NEXT: "file-deps": [
83+
// CAS: ],
84+
// CAS-NEXT: "link-libraries": [],
85+
// CAS-NEXT: "name": "A"
86+
// CAS-NEXT: }
87+
// CAS-NEXT: ],
88+
// CAS-NEXT: "translation-units": [
89+
// CAS: ]
90+
// CAS: }
91+
92+
5493
//--- build/compile-commands.json.in
5594

5695
[

0 commit comments

Comments
 (0)