Debian Codegraph @

clang/test/CodeGenObjCXX/exceptions.mm

raw
1 // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions -fobjc-exceptions -o - %s | FileCheck %s
2
3 @interface OCType @end
4 void opaque();
5
6 namespace test0 {
7
8 // CHECK-LABEL: define{{.*}} void @_ZN5test03fooEv
9 // CHECK-SAME: personality ptr @__objc_personality_v0
10 void foo() {
11 try {
12 // CHECK: invoke void @_Z6opaquev
13 opaque();
14 } catch (OCType *T) {
15 // CHECK: landingpad { ptr, i32 }
16 // CHECK-NEXT: catch ptr @"OBJC_EHTYPE_$_OCType"
17 }
18 }
19 }
20
21 @interface NSException
22 + new;
23 @end
24 namespace test1 {
25
26 void bar() {
27 @try {
28 throw [NSException new];
29 } @catch (id i) {
30 }
31 }
32 // CHECK: invoke void @objc_exception_throw(ptr [[CALL:%.*]]) [[NR:#[0-9]+]]
33 // CHECK: to label [[INVOKECONT1:%.*]] unwind label [[LPAD:%.*]]
34 }
35
36 // CHECK: attributes [[NR]] = { noreturn }