Debian Codegraph @

clang/test/ClangScanDeps/strip-input-args.m

raw
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s|DIR|%/t|g" %t/cdb1.json.template > %t/cdb1.json
4
5 // RUN: clang-scan-deps -compilation-database %t/cdb1.json -format experimental-full -mode preprocess-dependency-directives > %t/result1.txt
6
7 // RUN: FileCheck %s -input-file %t/result1.txt
8
9 // Verify that secondary actions get stripped, and that there's a single version
10 // of module A.
11
12 // CHECK: "modules": [
13 // CHECK-NEXT: {
14 // CHECK: "name": "A"
15 // CHECK: }
16 // CHECK-NOT: "name": "A"
17 // CHECK: "translation-units"
18
19 //--- cdb1.json.template
20 [
21 {
22 "directory": "DIR",
23 "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -fsyntax-only DIR/t1.m",
24 "file": "DIR/t1.m"
25 },
26 {
27 "directory": "DIR",
28 "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -fsyntax-only DIR/t2.m",
29 "file": "DIR/t2.m"
30 }
31 ]
32
33 //--- modules/A/module.modulemap
34
35 module A {
36 umbrella header "A.h"
37 }
38
39 //--- modules/A/A.h
40
41 typedef int A_t;
42
43 //--- t1.m
44 @import A;
45
46 //--- t2.m
47 @import A;