diff options
Diffstat (limited to 'test/CodeGen/X86/seh-safe-div.ll')
| -rw-r--r-- | test/CodeGen/X86/seh-safe-div.ll | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/test/CodeGen/X86/seh-safe-div.ll b/test/CodeGen/X86/seh-safe-div.ll index 699e58ee8bae8..60918cf07058a 100644 --- a/test/CodeGen/X86/seh-safe-div.ll +++ b/test/CodeGen/X86/seh-safe-div.ll @@ -27,35 +27,25 @@ define i32 @safe_div(i32* %n, i32* %d) personality i8* bitcast (i32 (...)* @__C_ entry: %r = alloca i32, align 4 invoke void @try_body(i32* %r, i32* %n, i32* %d) - to label %__try.cont unwind label %lpad + to label %__try.cont unwind label %lpad0 -lpad: - %vals = landingpad { i8*, i32 } - catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt0 to i8*) - catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt1 to i8*) - %ehptr = extractvalue { i8*, i32 } %vals, 0 - %sel = extractvalue { i8*, i32 } %vals, 1 - %filt0_val = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @safe_div_filt0 to i8*)) - %is_filt0 = icmp eq i32 %sel, %filt0_val - br i1 %is_filt0, label %handler0, label %eh.dispatch1 - -eh.dispatch1: - %filt1_val = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @safe_div_filt1 to i8*)) - %is_filt1 = icmp eq i32 %sel, %filt1_val - br i1 %is_filt1, label %handler1, label %eh.resume +lpad0: + %cs0 = catchswitch within none [label %handler0] unwind label %lpad1 handler0: - call void @puts(i8* getelementptr ([27 x i8], [27 x i8]* @str1, i32 0, i32 0)) + %p0 = catchpad within %cs0 [i8* bitcast (i32 (i8*, i8*)* @safe_div_filt0 to i8*)] + call void @puts(i8* getelementptr ([27 x i8], [27 x i8]* @str1, i32 0, i32 0)) [ "funclet"(token %p0) ] store i32 -1, i32* %r, align 4 - br label %__try.cont + catchret from %p0 to label %__try.cont + +lpad1: + %cs1 = catchswitch within none [label %handler1] unwind to caller handler1: - call void @puts(i8* getelementptr ([29 x i8], [29 x i8]* @str2, i32 0, i32 0)) + %p1 = catchpad within %cs1 [i8* bitcast (i32 (i8*, i8*)* @safe_div_filt1 to i8*)] + call void @puts(i8* getelementptr ([29 x i8], [29 x i8]* @str2, i32 0, i32 0)) [ "funclet"(token %p1) ] store i32 -2, i32* %r, align 4 - br label %__try.cont - -eh.resume: - resume { i8*, i32 } %vals + catchret from %p1 to label %__try.cont __try.cont: %safe_ret = load i32, i32* %r, align 4 @@ -68,7 +58,7 @@ __try.cont: ; CHECK: .seh_proc safe_div ; CHECK: .seh_handler __C_specific_handler, @unwind, @except ; CHECK: .Ltmp0: -; CHECK: leaq [[rloc:.*\(%rsp\)]], %rcx +; CHECK: leaq [[rloc:.*\(%rbp\)]], %rcx ; CHECK: callq try_body ; CHECK-NEXT: .Ltmp1 ; CHECK: [[cont_bb:\.LBB0_[0-9]+]]: @@ -77,32 +67,32 @@ __try.cont: ; Landing pad code -; CHECK: [[handler0:\.Ltmp[0-9]+]]: # Block address taken -; CHECK: # %handler0 +; CHECK: [[handler0:\.LBB0_[0-9]+]]: # %handler0 ; CHECK: callq puts ; CHECK: movl $-1, [[rloc]] ; CHECK: jmp [[cont_bb]] -; CHECK: [[handler1:\.Ltmp[0-9]+]]: # Block address taken -; CHECK: # %handler1 +; CHECK: [[handler1:\.LBB0_[0-9]+]]: # %handler1 ; CHECK: callq puts ; CHECK: movl $-2, [[rloc]] ; CHECK: jmp [[cont_bb]] ; CHECK: .seh_handlerdata -; CHECK-NEXT: .long 2 -; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .Lsafe_div$parent_frame_offset +; CHECK-NEXT: .long (.Llsda_end0-.Llsda_begin0)/16 +; CHECK-NEXT: .Llsda_begin0: +; CHECK-NEXT: .long .Ltmp0@IMGREL+1 ; CHECK-NEXT: .long .Ltmp1@IMGREL+1 ; CHECK-NEXT: .long safe_div_filt0@IMGREL ; CHECK-NEXT: .long [[handler0]]@IMGREL -; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .long .Ltmp0@IMGREL+1 ; CHECK-NEXT: .long .Ltmp1@IMGREL+1 ; CHECK-NEXT: .long safe_div_filt1@IMGREL ; CHECK-NEXT: .long [[handler1]]@IMGREL +; CHECK-NEXT: .Llsda_end0: ; CHECK: .text ; CHECK: .seh_endproc - define void @try_body(i32* %r, i32* %n, i32* %d) { entry: %0 = load i32, i32* %n, align 4 |
