@@ -22,20 +22,43 @@ module root1 { header "root1.h"}
2222// This is here to verify that the "root" directory doesn't clash with name of
2323// the "root" module.
2424
25+ // Verify the stable dir path.
26+ //--- Sysroot/usr/include/SysA/module.modulemap
27+ module SysA {
28+ header "SysA.h"
29+ }
30+
31+ //--- Sysroot/usr/include/SysA/SysA.h
32+ int SysVal = 42 ;
33+
2534//--- cdb.json.template
2635[{
2736 "file" : "",
2837 " directory ": " DIR ",
29- " command ": " clang - fmodules - fmodules - cache - path = DIR /cache - I DIR - x c "
38+ " command ": " clang - fmodules - fmodules - cache - path = DIR /cache - I DIR - isysroot DIR / Sysroot - IDIR / Sysroot / usr / include - x c "
3039}]
3140
3241// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
33- // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-names=root,root1,direct > %t/result.json
42+ // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -module-names=SysA, root,root1,direct > %t/result.json
3443// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
3544
3645// CHECK: {
3746// CHECK-NEXT: "modules": [
3847// CHECK-NEXT: {
48+ // CHECK-NEXT: "is-in-stable-directories": true,
49+ // CHECK-NEXT: "clang-module-deps": [],
50+ // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/Sysroot/usr/include/SysA/module.modulemap",
51+ // CHECK-NEXT: "command-line": [
52+ // CHECK: ],
53+ // CHECK-NEXT: "context-hash": "{{.*}}",
54+ // CHECK-NEXT: "file-deps": [
55+ // CHECK-NEXT: "[[PREFIX]]/Sysroot/usr/include/SysA/module.modulemap",
56+ // CHECK-NEXT: "[[PREFIX]]/Sysroot/usr/include/SysA/SysA.h"
57+ // CHECK-NEXT: ],
58+ // CHECK-NEXT: "link-libraries": [],
59+ // CHECK-NEXT: "name": "SysA"
60+ // CHECK-NEXT: },
61+ // CHECK-NEXT: {
3962// CHECK-NEXT: "clang-module-deps": [
4063// CHECK-NEXT: {
4164// CHECK-NEXT: "context-hash": "{{.*}}",
0 commit comments