summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-06-29 20:25:42 +0000
committerTed Kremenek <kremenek@apple.com>2010-06-29 20:25:42 +0000
commit3f1240b6146bfbe249e640631b9e9922ce9ba8bb (patch)
treed25eecf1350c2422a742d42968ad813209078ef3
parent24bc1b5b2ffd10c65572d8210e3df0aba7a13fbb (diff)
downloadbcm5719-llvm-3f1240b6146bfbe249e640631b9e9922ce9ba8bb.tar.gz
bcm5719-llvm-3f1240b6146bfbe249e640631b9e9922ce9ba8bb.zip
Add test case for <rdar://problem/4289832>. 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. llvm-svn: 107203
-rw-r--r--clang/test/SemaObjC/return.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/return.m b/clang/test/SemaObjC/return.m
index c578bf3b656..116abd19e7e 100644
--- a/clang/test/SemaObjC/return.m
+++ b/clang/test/SemaObjC/return.m
@@ -20,3 +20,22 @@ void test3(int a) { // expected-warning {{function could be attribute 'noreturn
@throw (id)0;
}
}
+
+// <rdar://problem/4289832> - 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
+ {
+ }
+}
+
OpenPOWER on IntegriCloud