[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ClangScanDeps / working-directory-option.c
blobd57497d405d30f242c5e40000183d1a9d6c139ae
1 // Test that -working-directory works even when it differs from the working
2 // directory of the filesystem.
4 // RUN: rm -rf %t
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"
17 // CHECK-NEXT: ]
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",
24 "file": "DIR/cwd/t.c"
27 //--- cwd/relative/h1.h
29 //--- cwd/t.c
30 #include "h1.h"