Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ClangScanDeps / response-file.c
blobc08105c1272029428201e52bb00801fb4e9f3965
1 // Check that the scanner can handle a response file input.
3 // RUN: rm -rf %t
4 // RUN: split-file %s %t
5 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
7 // RUN: clang-scan-deps -format experimental-full -compilation-database %t/cdb.json > %t/deps.json
9 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
11 // CHECK: "command-line": [
12 // CHECK: "-fsyntax-only"
13 // CHECK: "-x"
14 // CHECK-NEXT: "c"
15 // CHECK: "tu.c"
16 // CHECK: "-I"
17 // CHECK-NEXT: "include"
18 // CHECK: ],
19 // CHECK: "file-deps": [
20 // CHECK-NEXT: "[[PREFIX]]/tu.c"
21 // CHECK-NEXT: "[[PREFIX]]/include/header.h"
22 // CHECK-NEXT: ]
24 //--- cdb.json.template
26 "file": "DIR/t.c",
27 "directory": "DIR",
28 "command": "clang @DIR/args.txt"
31 //--- args.txt
32 @args_nested.txt
33 -fsyntax-only tu.c
35 //--- args_nested.txt
36 -I include
38 //--- include/header.h
40 //--- tu.c
41 #include "header.h"