From: Ted Kremenek Date: Wed, 23 Jan 2013 21:29:13 +0000 (+0000) Subject: Add a test case for 'analyzer_noreturn' on category methods. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38878aa394dc6e08146288e86939956bc742fb0b;p=clang Add a test case for 'analyzer_noreturn' on category methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173295 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m index 8207d3acfd..a58efdd029 100644 --- a/test/Analysis/NoReturn.m +++ b/test/Analysis/NoReturn.m @@ -112,4 +112,14 @@ void test_rdar11634353_positive() { *p = 0xDEADBEEF; // expected-warning {{null pointer}} } +// Test analyzer_noreturn on category methods. +@interface NSException (OBExtensions) ++ (void)raise:(NSString *)name reason:(NSString *)reason __attribute__((analyzer_noreturn)); +@end + +void PR11959(int *p) { + if (!p) + [NSException raise:@"Bad Pointer" reason:@"Who knows?"]; + *p = 0xDEADBEEF; // no-warning +}