blob: b3f73b1f9d52e0b5a5c6db16633a4543e43d910c [file] [log] [blame]
Fariborz Jahanian1eab0522013-01-10 19:02:56 +00001// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -fobjc-exceptions -o - %s | FileCheck %s
John McCall2ca705e2010-07-24 00:37:23 +00002
3@interface OCType @end
4void opaque();
5
6namespace test0 {
7
8 // CHECK: define void @_ZN5test03fooEv
9 void foo() {
10 try {
11 // CHECK: invoke void @_Z6opaquev
12 opaque();
13 } catch (OCType *T) {
Bill Wendlingf0724e82011-09-19 20:31:14 +000014 // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
15 // CHECK-NEXT: catch %struct._objc_typeinfo* @"OBJC_EHTYPE_$_OCType"
John McCall2ca705e2010-07-24 00:37:23 +000016 }
17 }
18}
Fariborz Jahanian1eab0522013-01-10 19:02:56 +000019
20// rdar://12605907
21@interface NSException
22 - new;
23@end
24namespace test1 {
25
26 void bar() {
27 @try {
28 throw [NSException new];
29 } @catch (id i) {
30 }
31 }
32// CHECK: invoke void @objc_exception_throw(i8* [[CALL:%.*]]) noreturn
33// CHECK: to label [[INVOKECONT1:%.*]] unwind label [[LPAD:%.*]]
34}