xref: /llvm-project/clang/test/ClangScanDeps/strip-input-args.m (revision ffa2a647c6a9dd2fab13a5e1bd4832b5b200d908)
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:            "command-line": [
15// CHECK-NOT:          "-arcmt-action=check"
16// CHECK-NOT:          "-objcmt-migrate-literals"
17// CHECK-NOT:          "-mt-migrate-directory"
18// CHECK:            ]
19// CHECK:            "name": "A"
20// CHECK:          }
21// CHECK-NOT:        "name": "A"
22// CHECK:        "translation-units"
23
24//--- cdb1.json.template
25[
26  {
27    "directory": "DIR",
28    "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -ccc-arcmt-check -fsyntax-only DIR/t1.m",
29    "file": "DIR/t1.m"
30  },
31  {
32    "directory": "DIR",
33    "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -ccc-objcmt-migrate bob -fsyntax-only DIR/t2.m",
34    "file": "DIR/t2.m"
35  }
36]
37
38//--- modules/A/module.modulemap
39
40module A {
41  umbrella header "A.h"
42}
43
44//--- modules/A/A.h
45
46typedef int A_t;
47
48//--- t1.m
49@import A;
50
51//--- t2.m
52@import A;
53