From e10c67f70407f31e1cc7fa9a5f8825adb0dfeef2 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 29 Jun 2010 20:25:42 +0000 Subject: [PATCH] Add test case for . Clang actuallys gets the test case right (for the noreturn warning) because the CFG doesn't support @try yet, but the test case is now present when we do properly implement CFG support for @try...@catch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107203 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaObjC/return.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/SemaObjC/return.m b/test/SemaObjC/return.m index c578bf3b65..116abd19e7 100644 --- a/test/SemaObjC/return.m +++ b/test/SemaObjC/return.m @@ -20,3 +20,22 @@ void test3(int a) { // expected-warning {{function could be attribute 'noreturn @throw (id)0; } } + +// - This code always returns, we should not +// issue a noreturn warning. +@class NSException; +@class NSString; +NSString *rdar_4289832() { // no-warning + @try + { + return @"a"; + } + @catch(NSException *exception) + { + return @"b"; + } + @finally + { + } +} +