88// RUN: sed -e "s|DIR|%/t|g" %t/cdb1.json.in > %t/cdb1.json
99// RUN: sed -e "s|DIR|%/t|g" %t/cdb3.json.in > %t/cdb3.json
1010// RUN: sed -e "s|DIR|%/t|g" %t/cdb4.json.in > %t/cdb4.json
11+ // RUN: sed -e "s|DIR|%/t|g" %t/cdb5.json.in > %t/cdb5.json
1112// RUN: clang-scan-deps -compilation-database %t/cdb0.json -format experimental-full > %t/result0.json
1213// RUN: clang-scan-deps -compilation-database %t/cdb1.json -format experimental-full > %t/result1.json
1314// It is not a typo to use cdb1.json for result2. We intend to use the same
1415// compilation database, but different clang-scan-deps optimize-args options.
1516// RUN: clang-scan-deps -compilation-database %t/cdb1.json -format experimental-full -optimize-args=header-search,system-warnings,vfs,canonicalize-macros > %t/result2.json
1617// RUN: clang-scan-deps -compilation-database %t/cdb3.json -format experimental-full > %t/result3.json
1718// RUN: clang-scan-deps -compilation-database %t/cdb4.json -format experimental-full > %t/result4.json
19+ // RUN: clang-scan-deps -compilation-database %t/cdb5.json -format experimental-full > %t/result5.json
1820// RUN: cat %t/result0.json %t/result1.json | FileCheck %s
1921// RUN: cat %t/result0.json %t/result2.json | FileCheck %s -check-prefix=SKIPOPT
2022// RUN: cat %t/result3.json %t/result4.json | FileCheck %s -check-prefix=RELPATH
23+ // RUN: cat %t/result0.json %t/result5.json | FileCheck %s
2124
2225//--- cdb0.json.in
2326[{
4851 "command" : "clang -c DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache -fprebuilt-module-path=.././module -IDIR/include/ -o DIR/tu.o " ,
4952 "file" : "DIR/tu.c"
5053}]
54+
55+ //--- cdb5.json.in
56+ [{
57+ "directory" : "DIR" ,
58+ "command" : "clang -c DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache -IDIR/include/ -Xclang -working-directory=DIR/a/ -o DIR/tu.o" ,
59+ "file" : "DIR/tu.c"
60+ }]
61+
5162//--- include/module.modulemap
5263module mod {
5364 header "mod .h "
@@ -58,9 +69,9 @@ module mod {
5869//--- tu.c
5970#include "mod .h "
6071
61- // Check that result0 and result1 compute the same hash with optimization
62- // on. The only difference between result0 and result1 is the compiler's
63- // working directory.
72+ // Check that result0 and result1/result5 compute the same hash with
73+ // optimization on. The only difference between result0 and result1/result5 is
74+ // the compiler's working directory.
6475// CHECK: {
6576// CHECK-NEXT: "modules": [
6677// CHECK-NEXT: {
0 commit comments