44 lines · c
1// Check that the scanner can handle a response file input. Uses -verbatim-args2// to ensure response files are expanded by the scanner library and not the3// argumeent adjuster in clang-scan-deps.4 5// RUN: rm -rf %t6// RUN: split-file %s %t7// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json8 9// RUN: clang-scan-deps -verbatim-args -format experimental-full -compilation-database %t/cdb.json > %t/deps.json10 11// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s12 13// CHECK: "command-line": [14// CHECK: "-fsyntax-only"15// CHECK: "-x"16// CHECK-NEXT: "c"17// CHECK: "tu.c"18// CHECK: "-I"19// CHECK-NEXT: "include"20// CHECK: ],21// CHECK: "file-deps": [22// CHECK-NEXT: "[[PREFIX]]/tu.c"23// CHECK-NEXT: "[[PREFIX]]/include/header.h"24// CHECK-NEXT: ]25 26//--- cdb.json.template27[{28 "file": "DIR/t.c",29 "directory": "DIR",30 "command": "clang @DIR/args.txt"31}]32 33//--- args.txt34@args_nested.txt35-fsyntax-only tu.c36 37//--- args_nested.txt38-I include39 40//--- include/header.h41 42//--- tu.c43#include "header.h"44