2010-07-06 09:34:17 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -O2 -o - %s | FileCheck %s
|
2010-04-24 03:12:32 +08:00
|
|
|
//
|
|
|
|
// <rdar://problem/7471679> [irgen] [eh] Exception code built with clang (x86_64) crashes
|
|
|
|
|
|
|
|
// Just check that we don't emit any dead blocks.
|
|
|
|
@interface NSArray @end
|
|
|
|
void f0() {
|
|
|
|
@try {
|
|
|
|
@try {
|
|
|
|
@throw @"a";
|
|
|
|
} @catch(NSArray *e) {
|
|
|
|
}
|
|
|
|
} @catch (id e) {
|
|
|
|
}
|
|
|
|
}
|
2010-07-06 09:34:17 +08:00
|
|
|
|
|
|
|
// CHECK: define void @f1()
|
|
|
|
void f1() {
|
|
|
|
extern void foo(void);
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
// CHECK: call void @objc_exception_try_enter
|
|
|
|
// CHECK-NEXT: getelementptr
|
|
|
|
// CHECK-NEXT: call i32 @_setjmp(
|
|
|
|
// CHECK-NEXT: icmp
|
|
|
|
// CHECK-NEXT: br i1
|
|
|
|
@try {
|
|
|
|
// CHECK: call void @foo()
|
|
|
|
foo();
|
|
|
|
// CHECK: call void @objc_exception_try_exit
|
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
|
|
|
// CHECK: call i8* @objc_exception_extract
|
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
} @finally {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|