From b7a619c1fa7a244d3fe88a8cf63eccd1a360bf33 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 7 Sep 2016 18:28:42 +0000 Subject: [PATCH] Resubmit "Add a test for clang-tidy using the clang-cl driver." This was originally reverted because the patch on the clang tooling side was reverted. That patch is being resubmitted, so this patch is resubmitted as well. llvm-svn: 280839 --- clang-tools-extra/test/clang-tidy/clang-cl-driver.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 clang-tools-extra/test/clang-tidy/clang-cl-driver.cpp diff --git a/clang-tools-extra/test/clang-tidy/clang-cl-driver.cpp b/clang-tools-extra/test/clang-tidy/clang-cl-driver.cpp new file mode 100644 index 0000000..fac0362 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/clang-cl-driver.cpp @@ -0,0 +1,17 @@ +// 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; +// CHECK: :[[@LINE-1]]:10: warning: use nullptr +#ifdef TEST1 +int *b = 0; +// CHECK: :[[@LINE-1]]:10: warning: use nullptr +#endif +#define foo 1 +#define bar 1 +#if FOO +int *c = 0; +// CHECK: :[[@LINE-1]]:10: warning: use nullptr +#endif +#if BAR +int *d = 0; +// CHECK: :[[@LINE-1]]:10: warning: use nullptr +#endif -- 2.7.4