Skip to content

Commit bb26fa8

Browse files
sylvain-audiaganea
authored andcommitted
[clang-scan-deps] Add support for clang-cl
clang-scan-deps contains some command line parsing and modifications. This patch adds support for clang-cl command options. Differential Revision: https://reviews.llvm.org/D92191
1 parent 488a19d commit bb26fa8

25 files changed

+314
-31
lines changed

clang/test/ClangScanDeps/Inputs/has_include_if_elif.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -E DIR/has_include_if_elif2.cpp -IInputs",
55
"file": "DIR/has_include_if_elif2.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E /IInputs -- DIR/has_include_if_elif2_clangcl.cpp",
10+
"file": "DIR/has_include_if_elif2_clangcl.cpp"
611
}
712
]

clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -E DIR/header_stat_before_open_input.m -iframework Inputs/frameworks",
55
"file": "DIR/header_stat_before_open_input.m"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E -Xclang -iframework -Xclang Inputs/frameworks -- DIR/header_stat_before_open_input_clangcl.m",
10+
"file": "DIR/header_stat_before_open_input_clangcl.m"
611
}
712
]

clang/test/ClangScanDeps/Inputs/headerwithdirname.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -c -IDIR -IDIR/foodir -IInputs DIR/headerwithdirname_input.cpp",
55
"file": "DIR/headerwithdirname_input.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /c /IDIR /IDIR/foodir -IInputs -- DIR/headerwithdirname_input_clangcl.cpp",
10+
"file": "DIR/headerwithdirname_input_clangcl.cpp"
611
}
712
]

clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -c -IDIR -IInputs DIR/headerwithdirname_input.cpp",
55
"file": "DIR/headerwithdirname_input.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /c /IDIR /IInputs -- DIR/headerwithdirname_input_clangcl.cpp",
10+
"file": "DIR/headerwithdirname_input_clangcl.cpp"
611
}
712
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"directory": "DIR",
4+
"command": "clang-cl /E /IInputs /D INCLUDE_HEADER2 /clang:-MD /clang:-MF /clang:DIR/modules_cdb2_clangcl.d /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -- DIR/modules_cdb_input2.cpp",
5+
"file": "DIR/modules_cdb_input2.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -- DIR/modules_cdb_input.cpp",
10+
"file": "DIR/modules_cdb_input.cpp"
11+
},
12+
{
13+
"directory": "DIR",
14+
"command": "clang-cl /E /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -o a.o -- DIR/modules_cdb_input.cpp",
15+
"file": "DIR/modules_cdb_input.cpp"
16+
},
17+
{
18+
"directory": "DIR",
19+
"command": "clang-cl /E /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -o b.o -- DIR/modules_cdb_input.cpp",
20+
"file": "DIR/modules_cdb_input.cpp"
21+
}
22+
]

clang/test/ClangScanDeps/Inputs/no-werror.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -E DIR/no-werror_input.cpp -IInputs -std=c++17 -Weverything -Werror",
55
"file": "DIR/no-werror.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E /IInputs /std:c++17 -Weverything -Werror -- DIR/no-werror_input_clangcl.cpp",
10+
"file": "DIR/no-werror_clangcl.cpp"
611
}
712
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"directory": "DIR",
4+
"command": "clang --driver-mode=cl /E /IInputs /D INCLUDE_HEADER2 /clang:-MD /clang:-MF /clang:DIR/regular_cdb2_clangcl.d -- DIR/regular_cdb_input2.cpp",
5+
"file": "DIR/regular_cdb_input2.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E /IInputs -- DIR/regular_cdb_input.cpp",
10+
"file": "DIR/regular_cdb_input.cpp"
11+
},
12+
{
13+
"directory": "DIR",
14+
"command": "clang-cl /E /IInputs /Foadena.o -- DIR/regular_cdb_input.cpp",
15+
"file": "DIR/regular_cdb_input.cpp"
16+
}
17+
]
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
[
22
{
33
"directory": "DIR",
4-
"command": "clang --analyze DIR/static-analyzer.c",
5-
"file": "DIR/static-analyzer.c"
4+
"command": "clang --analyze DIR/static-analyzer_clang.c",
5+
"file": "DIR/static-analyzer_clang.c"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl --analyze -- DIR/static-analyzer_clangcl.c",
10+
"file": "DIR/static-analyzer_clangcl.c"
611
}
712
]

clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -E -fsyntax-only DIR/strip_diag_serialize_input.cpp --serialize-diagnostics /does/not/exist",
55
"file": "DIR/strip_diag_serialize_input.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E --serialize-diagnostics A:/does/not/exist -- DIR/strip_diag_serialize_input_clangcl.cpp",
10+
"file": "DIR/strip_diag_serialize_input_clangcl.cpp"
611
}
712
]

clang/test/ClangScanDeps/Inputs/target-filename-cdb.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,50 @@
1818
"directory": "DIR",
1919
"command": "clang -E DIR/target-filename_input.cpp -o first.o -o last.o",
2020
"file": "DIR/target-filename_input.cpp"
21+
},
22+
{
23+
"directory": "DIR",
24+
"command": "clang-cl /E -- DIR/target-filename_input.cpp",
25+
"file": "DIR/target-filename_input.cpp"
26+
},
27+
{
28+
"directory": "DIR",
29+
"command": "clang-cl /E -o clangcl-a.o -- DIR/target-filename_input.cpp",
30+
"file": "DIR/target-filename_input.cpp"
31+
},
32+
{
33+
"directory": "DIR",
34+
"command": "clang-cl /E -oclangcl-b.o -- DIR/target-filename_input.cpp",
35+
"file": "DIR/target-filename_input.cpp"
36+
},
37+
{
38+
"directory": "DIR",
39+
"command": "clang-cl /E /o clangcl-c.o -- DIR/target-filename_input.cpp",
40+
"file": "DIR/target-filename_input.cpp"
41+
},
42+
{
43+
"directory": "DIR",
44+
"command": "clang-cl /E /oclangcl-d.o -- DIR/target-filename_input.cpp",
45+
"file": "DIR/target-filename_input.cpp"
46+
},
47+
{
48+
"directory": "DIR",
49+
"command": "clang-cl /E /Foclangcl-e.o -- DIR/target-filename_input.cpp",
50+
"file": "DIR/target-filename_input.cpp"
51+
},
52+
{
53+
"directory": "DIR",
54+
"command": "clang-cl /E -o clangcl-firstf.o -o clangcl-lastf.o -- DIR/target-filename_input.cpp",
55+
"file": "DIR/target-filename_input.cpp"
56+
},
57+
{
58+
"directory": "DIR",
59+
"command": "clang-cl /E /oclangcl-firstg.o /Foclangcl-lastg.o -- DIR/target-filename_input.cpp",
60+
"file": "DIR/target-filename_input.cpp"
61+
},
62+
{
63+
"directory": "DIR",
64+
"command": "clang-cl /E /Foclangcl-firsth.o -o clangcl-midh.o /oclangcl-lasth.o -- DIR/target-filename_input.cpp",
65+
"file": "DIR/target-filename_input.cpp"
2166
}
2267
]

clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"directory": "DIR",
44
"command": "clang -E DIR/vfsoverlay_input.cpp -IInputs -ivfsoverlay DIR/vfsoverlay.yaml",
55
"file": "DIR/vfsoverlay_input.cpp"
6+
},
7+
{
8+
"directory": "DIR",
9+
"command": "clang-cl /E /IInputs -Xclang -ivfsoverlay -Xclang DIR/vfsoverlay.yaml -- DIR/vfsoverlay_input_clangcl.cpp",
10+
"file": "DIR/vfsoverlay_input_clangcl.cpp"
611
}
712
]

clang/test/ClangScanDeps/error.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
// RUN: mkdir -p %t.dir
44
// RUN: cp %s %t.dir/regular_cdb_input.cpp
55
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
6+
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb
67
//
78
// RUN: not clang-scan-deps -compilation-database %t.cdb -j 1 2>%t.dir/errs
89
// RUN: echo EOF >> %t.dir/errs
910
// RUN: FileCheck %s --input-file %t.dir/errs
1011

12+
// RUN: not clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 2>%t.dir/errs_clangcl
13+
// RUN: echo EOF >> %t.dir/errs_clangcl
14+
// RUN: FileCheck %s --input-file %t.dir/errs_clangcl
15+
1116
#include "missing.h"
1217

1318
// CHECK: Error while scanning dependencies

clang/test/ClangScanDeps/has_include_if_elif.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: rm -rf %t.cdb
33
// RUN: mkdir -p %t.dir
44
// RUN: cp %s %t.dir/has_include_if_elif2.cpp
5+
// RUN: cp %s %t.dir/has_include_if_elif2_clangcl.cpp
56
// RUN: mkdir %t.dir/Inputs
67
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
78
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header2.h
@@ -36,3 +37,9 @@
3637
// CHECK-NEXT: Inputs{{/|\\}}header2.h
3738
// CHECK-NEXT: Inputs{{/|\\}}header3.h
3839
// CHECK-NEXT: Inputs{{/|\\}}header4.h
40+
41+
// CHECK: has_include_if_elif2_clangcl.cpp
42+
// CHECK-NEXT: Inputs{{/|\\}}header.h
43+
// CHECK-NEXT: Inputs{{/|\\}}header2.h
44+
// CHECK-NEXT: Inputs{{/|\\}}header3.h
45+
// CHECK-NEXT: Inputs{{/|\\}}header4.h

clang/test/ClangScanDeps/header_stat_before_open.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: rm -rf %t.cdb
33
// RUN: mkdir -p %t.dir
44
// RUN: cp %s %t.dir/header_stat_before_open_input.m
5+
// RUN: cp %s %t.dir/header_stat_before_open_input_clangcl.m
56
// RUN: mkdir %t.dir/Inputs
67
// RUN: cp -R %S/Inputs/frameworks %t.dir/Inputs/frameworks
78
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/header_stat_before_open_cdb.json > %t.cdb
@@ -16,3 +17,8 @@
1617
// CHECK-NEXT: header_stat_before_open_input.m
1718
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
1819
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}PrivateHeaders{{/|\\}}PrivateHeader.h
20+
21+
// CHECK: header_stat_before_open_input_clangcl.o
22+
// CHECK-NEXT: header_stat_before_open_input_clangcl.m
23+
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
24+
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}PrivateHeaders{{/|\\}}PrivateHeader.h

clang/test/ClangScanDeps/headerwithdirname.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// RUN: mkdir -p %t.dir
55
// RUN: mkdir -p %t.dir/foodir
66
// RUN: cp %s %t.dir/headerwithdirname_input.cpp
7+
// RUN: cp %s %t.dir/headerwithdirname_input_clangcl.cpp
78
// RUN: mkdir %t.dir/Inputs
89
// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
910
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirname.json > %t.cdb
@@ -15,3 +16,7 @@
1516
// CHECK: headerwithdirname_input.o
1617
// CHECK-NEXT: headerwithdirname_input.cpp
1718
// CHECK-NEXT: Inputs{{/|\\}}foodir
19+
20+
// CHECK: headerwithdirname_input_clangcl.o
21+
// CHECK-NEXT: headerwithdirname_input_clangcl.cpp
22+
// CHECK-NEXT: Inputs{{/|\\}}foodir

clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
// RUN: cp %S/Inputs/header.h %t.dir/foodir/foodirheader.h
99
// RUN: cp %s %t.dir/headerwithdirname_input.cpp
10+
// RUN: cp %s %t.dir/headerwithdirname_input_clangcl.cpp
1011
// RUN: mkdir %t.dir/Inputs
1112
// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
1213
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirnamefollowedbyinclude.json > %t.cdb
@@ -19,3 +20,7 @@
1920
// CHECK: headerwithdirname_input.o
2021
// CHECK-NEXT: headerwithdirname_input.cpp
2122
// CHECK-NEXT: Inputs{{/|\\}}foodir
23+
24+
// CHECK: headerwithdirname_input_clangcl.o
25+
// CHECK-NEXT: headerwithdirname_input_clangcl.cpp
26+
// CHECK-NEXT: Inputs{{/|\\}}foodir

clang/test/ClangScanDeps/modules-full.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@
88
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
99
// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
1010
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
11+
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb
1112
//
1213
// RUN: echo %t.dir > %t.result
1314
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -full-command-line \
1415
// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t.result
1516
// RUN: cat %t.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s
1617

18+
// RUN: echo %t.dir > %t_clangcl.result
19+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 4 -full-command-line \
20+
// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t_clangcl.result
21+
// RUN: cat %t_clangcl.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s
22+
1723
// FIXME: Backslash issues.
1824
// XFAIL: system-windows
1925

@@ -33,7 +39,7 @@
3339
// CHECK-NEXT: "command-line": [
3440
// CHECK-NEXT: "-fno-implicit-modules",
3541
// CHECK-NEXT: "-fno-implicit-module-maps",
36-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
42+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
3743
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
3844
// CHECK-NEXT: ],
3945
// CHECK-NEXT: "context-hash": "[[CONTEXT_HASH_H1]]",
@@ -84,7 +90,7 @@
8490
// CHECK-NEXT: "command-line": [
8591
// CHECK-NEXT: "-fno-implicit-modules",
8692
// CHECK-NEXT: "-fno-implicit-module-maps",
87-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
93+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
8894
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
8995
// CHECK-NEXT: ],
9096
// CHECK-NEXT: "file-deps": [
@@ -103,7 +109,7 @@
103109
// CHECK-NEXT: "command-line": [
104110
// CHECK-NEXT: "-fno-implicit-modules",
105111
// CHECK-NEXT: "-fno-implicit-module-maps",
106-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
112+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
107113
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
108114
// CHECK-NEXT: ],
109115
// CHECK-NEXT: "file-deps": [
@@ -122,7 +128,7 @@
122128
// CHECK-NEXT: "command-line": [
123129
// CHECK-NEXT: "-fno-implicit-modules",
124130
// CHECK-NEXT: "-fno-implicit-module-maps",
125-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
131+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
126132
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
127133
// CHECK-NEXT: ],
128134
// CHECK-NEXT: "file-deps": [
@@ -141,9 +147,9 @@
141147
// CHECK-NEXT: "command-line": [
142148
// CHECK-NEXT: "-fno-implicit-modules",
143149
// CHECK-NEXT: "-fno-implicit-module-maps",
144-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
150+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
145151
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap",
146-
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm",
152+
// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm",
147153
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
148154
// CHECK-NEXT: ],
149155
// CHECK-NEXT: "file-deps": [

clang/test/ClangScanDeps/modules.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: rm -rf %t.dir
22
// RUN: rm -rf %t.cdb
3+
// RUN: rm -rf %t_clangcl.cdb
34
// RUN: rm -rf %t.module-cache
5+
// RUN: rm -rf %t.module-cache_clangcl
46
// RUN: mkdir -p %t.dir
57
// RUN: cp %s %t.dir/modules_cdb_input.cpp
68
// RUN: cp %s %t.dir/modules_cdb_input2.cpp
@@ -9,9 +11,12 @@
911
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
1012
// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
1113
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
14+
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb
1215
//
1316
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
1417
// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
18+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-minimized-sources | \
19+
// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
1520
//
1621
// The output order is non-deterministic when using more than one thread,
1722
// so check the output using two runs. Note that the 'NOT' check is not used
@@ -20,12 +25,20 @@
2025
//
2126
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
2227
// RUN: FileCheck --check-prefix=CHECK1 %s
28+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
29+
// RUN: FileCheck --check-prefix=CHECK1 %s
2330
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
2431
// RUN: FileCheck --check-prefix=CHECK1 %s
32+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
33+
// RUN: FileCheck --check-prefix=CHECK1 %s
2534
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
2635
// RUN: FileCheck --check-prefix=CHECK2 %s
36+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
37+
// RUN: FileCheck --check-prefix=CHECK2 %s
2738
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
2839
// RUN: FileCheck --check-prefix=CHECK2 %s
40+
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
41+
// RUN: FileCheck --check-prefix=CHECK2 %s
2942

3043
#include "header.h"
3144

clang/test/ClangScanDeps/no-werror.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: rm -rf %t.cdb
33
// RUN: mkdir -p %t.dir
44
// RUN: cp %s %t.dir/no-werror_input.cpp
5+
// RUN: cp %s %t.dir/no-werror_input_clangcl.cpp
56
// RUN: mkdir %t.dir/Inputs
67
// RUN: cp %S/Inputs/sys-header.h %t.dir/Inputs/sys-header.h
78
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/no-werror.json > %t.cdb
@@ -14,3 +15,6 @@
1415

1516
// CHECK: no-werror_input.cpp
1617
// CHECK-NEXT: Inputs{{/|\\}}sys-header.h
18+
19+
// CHECK: no-werror_input_clangcl.cpp
20+
// CHECK-NEXT: Inputs{{/|\\}}sys-header.h

0 commit comments

Comments
 (0)