aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-07-08 23:57:29 +0000
committerJordy Rose <jediknil@belkadan.com>2010-07-08 23:57:29 +0000
commitd325ffb9cbd26b6a3f219d115191d9a00b6dea8c (patch)
treea1242aeebc4283596aad107a046ecf50de04f03d /test/Analysis
parent40ed9a13f5b67b2941f5a9521616e57e9e31ba97 (diff)
Cleanup in CStringChecker. Now properly bifurcates the state for zero/nonzero sizes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/bstring.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/bstring.c b/test/Analysis/bstring.c
index 59d6318db3..f4ddb0a3d0 100644
--- a/test/Analysis/bstring.c
+++ b/test/Analysis/bstring.c
@@ -238,6 +238,14 @@ void memcmp5 (char *input) {
(void)*(char*)0; // no-warning
}
+void memcmp6 (char *a, char *b, size_t n) {
+ int result = memcmp(a, b, n);
+ if (result != 0)
+ return;
+ if (n == 0)
+ (void)*(char*)0; // expected-warning{{null}}
+}
+
//===----------------------------------------------------------------------===
// bcopy()
//===----------------------------------------------------------------------===