[PATCH] D23480: Add a test for clang-tidy using the clang cl driver

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 13 10:24:30 PDT 2016

alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with two nits.

> In order to get this to work, the positional arguments must use --driver-mode=cl <args>, and NOT clang-cl <args>

It's not that important for the fixed compilation database, as long as there is a way to specify the driver mode. However, we need to make sure clang-tidy is able to figure out correct driver mode from JSON compilation databases generated on Windows for clang-cl builds. It should be a separate test though.

Comment at: test/clang-tidy/clang-cl-driver.cpp:1
@@ +1,2 @@
+// RUN: clang-tidy -checks=-*,modernize-use-nullptr %s -- --driver-mode=cl /DTEST1 /DFOO=foo /DBAR=bar | FileCheck -implicit-check-not="{{warning|error}}:" %s
+int *a = 0;
I wonder whether the `/Dname#value` format should work in clang-cl mode as well (it's supported by cl.exe, if I understand https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx correctly).

Comment at: test/clang-tidy/clang-cl-driver.cpp:18
@@ +17,1 @@
\ No newline at end of file

Please fix the "No newline at end of file".


More information about the cfe-commits mailing list