brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · b543231 Raw
57 lines · c
1// Check that the scanner can adjust arguments by reading .rsp files in advance.2 3// RUN: rm -rf %t4// RUN: split-file %s %t5 6// First run the tests with a .cdb7// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json8// RUN: sed -e "s|DIR|%/t|g" %t/args_nested.template > %t/args_nested.rsp9 10// RUN: cp %t/args_compilation.rsp %t/args.rsp11// RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json12// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s13 14// RUN: cp %t/args_preprocess.rsp %t/args.rsp15// RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json16// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s17 18 19// Now run the tests again with a in-place compilation database20// RUN: cd %t21 22// RUN: cp args_compilation.rsp args.rsp23// RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp24// RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s25 26// RUN: cp args_preprocess.rsp args.rsp27// RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp28// RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s29 30// Here we ensure that we got a qualified .obj with its full path, since that's what we're passing with /Fo31// CHECK: [[PREFIX]]/tu.obj:32 33//--- cdb.json.template34[{35  "file": "DIR/tu.cpp",36  "directory": "DIR",37  "command": "clang-cl @DIR/args.rsp"38}]39 40//--- args_compilation.rsp41@args_nested.rsp42/c43 44//--- args_preprocess.rsp45@args_nested.rsp46/E47 48//--- args_nested.template49/I include50tu.cpp51/FoDIR/tu.obj52 53//--- include/header.h54 55//--- tu.cpp56#include "header.h"57