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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2010-06-29 20:25:42 +00:00
Родитель 12eb5d6aa8
Коммит e10c67f704
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -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
{
}
}