[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ClangScanDeps / line-directive.c
blob4bf532167a9352248960e53e8718e7e3883db967
1 // Check that we get the right file dependencies and not the declared paths from
2 // line directives.
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json \
9 // RUN: -mode preprocess-dependency-directives -format experimental-full > %t/deps.json
11 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
13 // CHECK: "file-deps": [
14 // CHECK-NEXT: "[[PREFIX]]/tu.c"
15 // CHECK-NEXT: "[[PREFIX]]/header.h"
16 // CHECK-NEXT: ]
18 //--- cdb.json.template
20 "file": "DIR/tu.c",
21 "directory": "DIR",
22 "command": "clang -fsyntax-only DIR/tu.c"
25 //--- other.h
27 //--- other.c
29 //--- header.h
30 #line 100 "other.h"
32 //--- tu.c
33 #include "header.h"
34 #line 100 "other.c"