diff options
| author | Anna Zaks <ganna@apple.com> | 2011-08-18 19:02:46 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2011-08-18 19:02:46 +0000 |
| commit | 3c06d7f442d21863dd4734397fc232458b735ede (patch) | |
| tree | de2735ce9bca762e1e9e52136a1b9b43a4239f64 | |
| parent | 0071f8a48edc1f170c3522ca9c847fabd27f8529 (diff) | |
| download | bcm5719-llvm-3c06d7f442d21863dd4734397fc232458b735ede.tar.gz bcm5719-llvm-3c06d7f442d21863dd4734397fc232458b735ede.zip | |
Add a test for checking that custom diagnostic visitors are working.
llvm-svn: 137970
| -rw-r--r-- | clang/test/Analysis/default-diagnostic-visitors.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Analysis/default-diagnostic-visitors.c b/clang/test/Analysis/default-diagnostic-visitors.c new file mode 100644 index 00000000000..9cb9ba8c33e --- /dev/null +++ b/clang/test/Analysis/default-diagnostic-visitors.c @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s + +// This file is for testing enhanced diagnostics produced by the default BugReporterVisitors. + +int getPasswordAndItem() +{ + int err = 0; + int *password; // expected-note {{Variable 'password' declared without an initial value}} + if (password == 0) { // expected-warning {{The left operand of '==' is a garbage value}} // expected-note {{The left operand of '==' is a garbage value}} + err = *password; + } + return err; +} |

