diff options
author | Alexander Kornienko <alexfh@google.com> | 2014-02-12 09:52:07 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2014-02-12 09:52:07 +0000 |
commit | d1afc707956d735f65873198ed737ac4ef086d5e (patch) | |
tree | 234e39e7e8142603aa906f06f3b597c7ef16ef66 /clang-tools-extra/test/clang-tidy/static-analyzer.cpp | |
parent | d90ec5717a821e1d3841c05a6553801181587564 (diff) | |
download | bcm5719-llvm-d1afc707956d735f65873198ed737ac4ef086d5e.tar.gz bcm5719-llvm-d1afc707956d735f65873198ed737ac4ef086d5e.zip |
Consume checker names from clang static analyzer.
Summary: This patch depends on patches D2556 and D2557.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, jordan_rose, krememek
Differential Revision: http://llvm-reviews.chandlerc.com/D2620
llvm-svn: 201221
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/static-analyzer.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/static-analyzer.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/clang-tools-extra/test/clang-tidy/static-analyzer.cpp b/clang-tools-extra/test/clang-tidy/static-analyzer.cpp index 8e14773847a..66f56c758ce 100644 --- a/clang-tools-extra/test/clang-tidy/static-analyzer.cpp +++ b/clang-tools-extra/test/clang-tidy/static-analyzer.cpp @@ -1,8 +1,17 @@ -// RUN: clang-tidy %s -checks='clang-analyzer-cplusplus' -- | FileCheck %s +// RUN: clang-tidy %s -checks='clang-analyzer-' -- | FileCheck %s +extern void *malloc(unsigned long); +extern void free(void *); void f() { int *p = new int(42); delete p; delete p; - // CHECK: warning: Attempt to free released memory + // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete] +} + +void g() { + void *q = malloc(132); + free(q); + free(q); + // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc] } |