summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/objc-try-catch-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Parser/objc-try-catch-1.m')
-rw-r--r--clang/test/Parser/objc-try-catch-1.m62
1 files changed, 38 insertions, 24 deletions
diff --git a/clang/test/Parser/objc-try-catch-1.m b/clang/test/Parser/objc-try-catch-1.m
index 6a0acd13dcb..d6ad8d38ef7 100644
--- a/clang/test/Parser/objc-try-catch-1.m
+++ b/clang/test/Parser/objc-try-catch-1.m
@@ -10,29 +10,43 @@ void * proc();
void * foo()
{
- @try {
- return proc();
- }
- @catch (Frob* ex) {
- @throw;
- }
- @catch (Frob1* ex) {
- @throw proc();
- }
- @finally {
- @try {
- return proc();
- }
- @catch (Frob* ex) {
- @throw 1,2;
- }
- @catch(...) {
- @throw (4,3,proc());
- }
- }
-
- @try { // expected-error {{@try statment without a @catch and @finally clause}}
- return proc();
- }
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ @throw;
+ }
+ @catch (Frob1* ex) {
+ @throw proc();
+ }
+ @finally {
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ @throw 1,2;
+ }
+ @catch(...) {
+ @throw (4,3,proc());
+ }
+ }
+
+ @try { // expected-error {{@try statment without a @catch and @finally clause}}
+ return proc();
+ }
+}
+
+
+void bar()
+{
+ @try {}// expected-error {{@try statment without a @catch and @finally clause}}
+ @"s" {} // expected-warning {{result unused}} expected-error {{expected ';'}}
+}
+
+void baz()
+{
+ @try {}// expected-error {{@try statment without a @catch and @finally clause}}
+ @try {}// expected-error {{undeclared identifier}}
+ @finally {}
}
OpenPOWER on IntegriCloud