summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-07-08 15:41:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-07-08 15:41:20 +0000
commitee5872187571906c4430e181184142112742468c (patch)
tree04c1567ffaf2cb2afeece5e5a7574917fe27b8cd /clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
parentd261e98f3db16c0ba257878d2662d6e39e9bfa0f (diff)
downloadbcm5719-llvm-ee5872187571906c4430e181184142112742468c.tar.gz
bcm5719-llvm-ee5872187571906c4430e181184142112742468c.zip
[clang-tidy] Address review comments for the Twine checker.
- Remove unused includes. - Minor wording fix. - Added support to check for clang-tidy messages to check_clang_tidy_fix.sh = Updated test case. llvm-svn: 212540
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp b/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
index 0f134a5500a..dc8f8f0cb07 100644
--- a/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
+++ b/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
@@ -1,7 +1,5 @@
-// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
-// RUN: clang-tidy %t.cpp -checks='-*,llvm-twine-local' -fix -- > %t.msg 2>&1
-// RUN: FileCheck -input-file=%t.cpp %s
-// RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s
+// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-twine-local %t
+// REQUIRES: shell
namespace llvm {
class Twine {
@@ -17,19 +15,19 @@ using namespace llvm;
void foo(const Twine &x);
static Twine Moo = Twine("bark") + "bah";
-// CHECK-MASSAGES: twine variables are prone to use after free bugs
+// CHECK-MASSAGES: twine variables are prone to use-after-free bugs
// CHECK-MESSAGES: note: FIX-IT applied suggested code changes
// CHECK: static std::string Moo = (Twine("bark") + "bah").str();
int main() {
const Twine t = Twine("a") + "b" + Twine(42);
-// CHECK-MASSAGES: twine variables are prone to use after free bugs
+// CHECK-MASSAGES: twine variables are prone to use-after-free bugs
// CHECK-MESSAGES: note: FIX-IT applied suggested code changes
// CHECK: std::string t = (Twine("a") + "b" + Twine(42)).str();
foo(Twine("a") + "b");
Twine Prefix = false ? "__INT_FAST" : "__UINT_FAST";
-// CHECK-MASSAGES: twine variables are prone to use after free bugs
+// CHECK-MASSAGES: twine variables are prone to use-after-free bugs
// CHECK-MESSAGES: note: FIX-IT applied suggested code changes
// CHECK: const char * Prefix = false ? "__INT_FAST" : "__UINT_FAST";
}
OpenPOWER on IntegriCloud