Bill Wendling f0724e8e06 Throw the switch to convert clang to the new exception handling model!
This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.

The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.

llvm-svn: 140049
2011-09-19 20:31:14 +00:00

22 lines
869 B
C

// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fexceptions -fblocks | FileCheck %s
// RUN: %clang_cc1 -triple armv7-apple-unknown -emit-llvm -o - %s -fexceptions -fsjlj-exceptions -fblocks | FileCheck %s -check-prefix=CHECK-ARM
// rdar://problem/8621849
void test1() {
extern void test1_helper(void (^)(int));
// CHECK: define void @test1()
// CHECK-ARM: define arm_aapcscc void @test1()
__block int x = 10;
// CHECK: invoke void @test1_helper(
// CHECK-ARM: invoke arm_aapcscc void @test1_helper(
test1_helper(^(int v) { x = v; });
// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
// CHECK-NEXT: cleanup
// CHECK-ARM: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_sj0 to i8*)
// CHECK-ARM-NEXT: cleanup
}