1 // Test that -working-directory works even when it differs from the working
2 // directory of the filesystem.
5 // RUN: mkdir -p %t/other
6 // RUN: split-file %s %t
7 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
9 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
10 // RUN: > %t/deps.json
12 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
14 // CHECK: "file-deps": [
15 // CHECK-NEXT: "[[PREFIX]]/cwd/t.c"
16 // CHECK-NEXT: "[[PREFIX]]/cwd/relative/h1.h"
18 // CHECK-NEXT: "input-file": "[[PREFIX]]/cwd/t.c"
20 //--- cdb.json.template
22 "directory": "DIR/other",
23 "command": "clang -c t.c -I relative -working-directory DIR/cwd",
27 //--- cwd/relative/h1.h