From: Anna Zaks Date: Tue, 1 May 2012 21:10:29 +0000 (+0000) Subject: [analyzer] Test case reported for a reported false positive, now fixed. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33e4a1d3f061a2b8549fbfbf2d15a396cc395dca;p=clang [analyzer] Test case reported for a reported false positive, now fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155945 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c index 1fc874349e..c19ee3259c 100644 --- a/test/Analysis/malloc.c +++ b/test/Analysis/malloc.c @@ -783,6 +783,15 @@ void *radar11329382(unsigned bl) { return ptr; // no warning } +void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__)); +int strcmp(const char *, const char *); +char *a (void); +void radar11270219(void) { + char *x = a(), *y = a(); + (__builtin_expect(!(x && y), 0) ? __assert_rtn(__func__, "/Users/zaks/tmp/ex.c", 24, "x && y") : (void)0); + strcmp(x, y); // no warning +} + // ---------------------------------------------------------------------------- // Below are the known false positives.