diff options
Diffstat (limited to 'clang/test/Analysis/bstring.c')
-rw-r--r-- | clang/test/Analysis/bstring.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/bstring.c b/clang/test/Analysis/bstring.c index 8d8f64cebec..2d53402a9ad 100644 --- a/clang/test/Analysis/bstring.c +++ b/clang/test/Analysis/bstring.c @@ -462,6 +462,12 @@ int memcmp7 (char *a, size_t x, size_t y, size_t n) { memcmp(&a[x*y], a, n); } +int memcmp8(char *a, size_t n) { + char *b = 0; + // Do not warn about the first argument! + return memcmp(a, b, n); // expected-warning{{Null pointer passed as 2nd argument to memory comparison function}} +} + //===----------------------------------------------------------------------=== // bcopy() //===----------------------------------------------------------------------=== |