-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang][DependencyScanning] Add Test Coverage of StabeDirs during By-Name Lookups
#168143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
qiongsiwu
merged 2 commits into
llvm:main
from
qiongsiwu:eng_136303612_stable_dir_testing
Nov 18, 2025
Merged
[clang][DependencyScanning] Add Test Coverage of StabeDirs during By-Name Lookups
#168143
qiongsiwu
merged 2 commits into
llvm:main
from
qiongsiwu:eng_136303612_stable_dir_testing
Nov 18, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
@llvm/pr-subscribers-clang Author: Qiongsi Wu (qiongsiwu) ChangesThis PR adds some test coverage for Full diff: https://github.com/llvm/llvm-project/pull/168143.diff 1 Files Affected:
diff --git a/clang/test/ClangScanDeps/modules-full-by-mult-mod-names.c b/clang/test/ClangScanDeps/modules-full-by-mult-mod-names.c
index 030f7f3427810..e4248e226b7d3 100644
--- a/clang/test/ClangScanDeps/modules-full-by-mult-mod-names.c
+++ b/clang/test/ClangScanDeps/modules-full-by-mult-mod-names.c
@@ -22,20 +22,43 @@ module root1 { header "root1.h"}
// This is here to verify that the "root" directory doesn't clash with name of
// the "root" module.
+// Verify the stable dir path.
+//--- Sysroot/usr/include/SysA/module.modulemap
+module SysA {
+ header "SysA.h"
+}
+
+//--- Sysroot/usr/include/SysA/SysA.h
+int SysVal = 42;
+
//--- cdb.json.template
[{
"file": "",
"directory": "DIR",
- "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR -x c"
+ "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR -isysroot DIR/Sysroot -IDIR/Sysroot/usr/include -x c"
}]
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
-// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-names=root,root1,direct > %t/result.json
+// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-names=SysA,root,root1,direct > %t/result.json
// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
// CHECK: {
// CHECK-NEXT: "modules": [
// CHECK-NEXT: {
+// CHECK-NEXT: "is-in-stable-directories": true,
+// CHECK-NEXT: "clang-module-deps": [],
+// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Sysroot/usr/include/SysA/module.modulemap",
+// CHECK-NEXT: "command-line": [
+// CHECK: ],
+// CHECK-NEXT: "context-hash": "{{.*}}",
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]/Sysroot/usr/include/SysA/module.modulemap",
+// CHECK-NEXT: "[[PREFIX]]/Sysroot/usr/include/SysA/SysA.h"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "name": "SysA"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
// CHECK-NEXT: "clang-module-deps": [
// CHECK-NEXT: {
// CHECK-NEXT: "context-hash": "{{.*}}",
|
a709fe8 to
dfb1a77
Compare
jansvoboda11
approved these changes
Nov 18, 2025
qiongsiwu
added a commit
to qiongsiwu/llvm-project
that referenced
this pull request
Nov 19, 2025
…y-Name Lookups (llvm#168143) This PR adds some test coverage for `StableDirs` during by-name lookups. (cherry picked from commit 3f61402)
qiongsiwu
added a commit
to swiftlang/llvm-project
that referenced
this pull request
Nov 20, 2025
…e Lookups (#11861) This PR cherry-picks two tests added to upstream and next to check for stable directory and CAS setup for by-name dependency queries. * [clang][DependencyScanning] Add Test Coverage of `StabeDirs` during By-Name Lookups (llvm#168143) This PR adds some test coverage for `StableDirs` during by-name lookups. (cherry picked from commit 3f61402) * [clang][DependencyScanning] Fix `StableDir` and `DependencyActionController` Setup for By-Name Lookups (#11822) llvm#164345 merge conflict resolution with `next` introduced two issues. 1. It did not correctly pick up the logic to set `StableDir` for `CompilerInstanceWithContext`. 2. It did not correctly setup the action controller for CAS. This PR fixes both issues. (cherry picked from commit 31fe4fc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds some test coverage for
StableDirsduring by-name lookups.