[clang] [clang][DependencyScanning] Add Test Coverage of `StabeDirs` during By-Name Lookups (PR #168143)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 17 10:55:37 PST 2025
================
@@ -0,0 +1,43 @@
+// UNSUPPORTED: system-windows
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+
+// 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 -isysroot DIR/Sysroot -IDIR/Sysroot/usr/include -x c"
+}]
----------------
jansvoboda11 wrote:
If you're invoking `clang-scan-deps` just once with a compilation database containing single invocation, I suggest using this simpler form instead and drop the `.template` file and the `sed` invocation:
```
clang-scan-deps -format experimental-full -module-names=SysA -o %t/result.json -- %clang -fmodules -fmodules-cache-path=%t/cache -isysroot %t/Sysroot -I%t/Sysroot/usr/include -x c
```
https://github.com/llvm/llvm-project/pull/168143
More information about the cfe-commits
mailing list