Skip to content

Conversation

@qiongsiwu
Copy link
Contributor

This PR adds some test coverage for StableDirs during by-name lookups.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Nov 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2025

@llvm/pr-subscribers-clang

Author: Qiongsi Wu (qiongsiwu)

Changes

This PR adds some test coverage for StableDirs during by-name lookups.


Full diff: https://github.com/llvm/llvm-project/pull/168143.diff

1 Files Affected:

  • (modified) clang/test/ClangScanDeps/modules-full-by-mult-mod-names.c (+25-2)
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": "{{.*}}", 
@qiongsiwu qiongsiwu force-pushed the eng_136303612_stable_dir_testing branch from a709fe8 to dfb1a77 Compare November 15, 2025 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

2 participants