Bump version to 19.1.3
[llvm-project.git] / clang / test / ClangScanDeps / response-file-clang-cl.c
blobb543231f4bb1be4cc964d1d25f473961ff956642
1 // Check that the scanner can adjust arguments by reading .rsp files in advance.
3 // RUN: rm -rf %t
4 // RUN: split-file %s %t
6 // First run the tests with a .cdb
7 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: sed -e "s|DIR|%/t|g" %t/args_nested.template > %t/args_nested.rsp
10 // RUN: cp %t/args_compilation.rsp %t/args.rsp
11 // RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json
12 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
14 // RUN: cp %t/args_preprocess.rsp %t/args.rsp
15 // RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json
16 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
19 // Now run the tests again with a in-place compilation database
20 // RUN: cd %t
22 // RUN: cp args_compilation.rsp args.rsp
23 // RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp
24 // RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
26 // RUN: cp args_preprocess.rsp args.rsp
27 // RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp
28 // RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
30 // Here we ensure that we got a qualified .obj with its full path, since that's what we're passing with /Fo
31 // CHECK: [[PREFIX]]/tu.obj:
33 //--- cdb.json.template
35 "file": "DIR/tu.cpp",
36 "directory": "DIR",
37 "command": "clang-cl @DIR/args.rsp"
40 //--- args_compilation.rsp
41 @args_nested.rsp
44 //--- args_preprocess.rsp
45 @args_nested.rsp
48 //--- args_nested.template
49 /I include
50 tu.cpp
51 /FoDIR/tu.obj
53 //--- include/header.h
55 //--- tu.cpp
56 #include "header.h"