From: Ted Kremenek Date: Sat, 26 Sep 2009 17:18:44 +0000 (+0000) Subject: Added test case for . X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=022a1253c021aaa03fa7d65b04f237da9613f8fd;p=clang Added test case for . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82866 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index 9c27029d66..565dc61f3b 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -657,3 +657,27 @@ void pr_4988(void) { pr_4988; // expected-warning{{expression result unused}} } +// - A 'signed char' is used as a flag, which is +// implicitly converted to an int. +void *rdar7152418_bar(); +@interface RDar7152418 { + signed char x; +} +-(char)foo; +@end; +@implementation RDar7152418 +-(char)foo { + char *p = 0; + void *result = 0; + if (x) { + result = rdar7152418_bar(); + p = "hello"; + } + if (!result) { + result = rdar7152418_bar(); + if (result && x) + return *p; // no-warning + } + return 1; +} +