diff options
Diffstat (limited to 'test/CodeGen/X86/seh-except-finally.ll')
-rw-r--r-- | test/CodeGen/X86/seh-except-finally.ll | 71 |
1 files changed, 25 insertions, 46 deletions
diff --git a/test/CodeGen/X86/seh-except-finally.ll b/test/CodeGen/X86/seh-except-finally.ll index 0630d001bb76..b29788cd015d 100644 --- a/test/CodeGen/X86/seh-except-finally.ll +++ b/test/CodeGen/X86/seh-except-finally.ll @@ -38,84 +38,63 @@ entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 invoke void @crash() #5 - to label %invoke.cont unwind label %lpad + to label %invoke.cont unwind label %__finally invoke.cont: ; preds = %entry %0 = call i8* @llvm.localaddress() invoke void @"\01?fin$0@0@use_both@@"(i1 zeroext false, i8* %0) #5 - to label %invoke.cont2 unwind label %lpad1 + to label %invoke.cont2 unwind label %catch.dispatch invoke.cont2: ; preds = %invoke.cont br label %__try.cont -lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } - cleanup - catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*) - %2 = extractvalue { i8*, i32 } %1, 0 - store i8* %2, i8** %exn.slot - %3 = extractvalue { i8*, i32 } %1, 1 - store i32 %3, i32* %ehselector.slot - %4 = call i8* @llvm.localaddress() - invoke void @"\01?fin$0@0@use_both@@"(i1 zeroext true, i8* %4) #5 - to label %invoke.cont3 unwind label %lpad1 - -lpad1: ; preds = %lpad, %invoke.cont - %5 = landingpad { i8*, i32 } - catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*) - %6 = extractvalue { i8*, i32 } %5, 0 - store i8* %6, i8** %exn.slot - %7 = extractvalue { i8*, i32 } %5, 1 - store i32 %7, i32* %ehselector.slot - br label %catch.dispatch +__finally: ; preds = %entry + %cleanuppad = cleanuppad within none [] + %locals = call i8* @llvm.localaddress() + invoke void @"\01?fin$0@0@use_both@@"(i1 zeroext true, i8* %locals) #5 [ "funclet"(token %cleanuppad) ] + to label %invoke.cont3 unwind label %catch.dispatch -invoke.cont3: ; preds = %lpad - br label %catch.dispatch +invoke.cont3: ; preds = %__finally + cleanupret from %cleanuppad unwind label %catch.dispatch catch.dispatch: ; preds = %invoke.cont3, %lpad1 - %sel = load i32, i32* %ehselector.slot - %8 = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*)) #6 - %matches = icmp eq i32 %sel, %8 - br i1 %matches, label %__except, label %eh.resume + %cs1 = catchswitch within none [label %__except] unwind to caller __except: ; preds = %catch.dispatch - %call = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @"\01??_C@_08MLCMLGHM@__except?$AA@", i32 0, i32 0)) - br label %__try.cont + %catchpad = catchpad within %cs1 [i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*)] + %call = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @"\01??_C@_08MLCMLGHM@__except?$AA@", i32 0, i32 0)) [ "funclet"(token %catchpad) ] + catchret from %catchpad to label %__try.cont __try.cont: ; preds = %__except, %invoke.cont2 ret void - -eh.resume: ; preds = %catch.dispatch - %exn = load i8*, i8** %exn.slot - %sel4 = load i32, i32* %ehselector.slot - %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 - %lpad.val5 = insertvalue { i8*, i32 } %lpad.val, i32 %sel4, 1 - resume { i8*, i32 } %lpad.val5 } ; CHECK-LABEL: use_both: ; CHECK: .Ltmp0 ; CHECK: callq crash ; CHECK: .Ltmp1 -; CHECK: .Ltmp3 -; CHECK: callq "?fin$0@0@use_both@@" ; CHECK: .Ltmp4 +; CHECK: callq "?fin$0@0@use_both@@" +; CHECK: .Ltmp5 ; CHECK: retq ; ; CHECK: .seh_handlerdata -; CHECK-NEXT: .long 3 -; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .Luse_both$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 "?fin$0@0@use_both@@"@IMGREL +; CHECK-NEXT: .long "?dtor$2@?0?use_both@4HA"@IMGREL ; CHECK-NEXT: .long 0 -; CHECK-NEXT: .long .Ltmp0@IMGREL +; CHECK-NEXT: .long .Ltmp0@IMGREL+1 ; CHECK-NEXT: .long .Ltmp1@IMGREL+1 ; CHECK-NEXT: .long "?filt$0@0@use_both@@"@IMGREL -; CHECK-NEXT: .long .Ltmp{{[0-9]+}}@IMGREL -; CHECK-NEXT: .long .Ltmp3@IMGREL +; CHECK-NEXT: .long .LBB0_{{[0-9]+}}@IMGREL ; CHECK-NEXT: .long .Ltmp4@IMGREL+1 +; CHECK-NEXT: .long .Ltmp5@IMGREL+1 ; CHECK-NEXT: .long "?filt$0@0@use_both@@"@IMGREL -; CHECK-NEXT: .long .Ltmp{{[0-9]+}}@IMGREL +; CHECK-NEXT: .long .LBB0_{{[0-9]+}}@IMGREL +; CHECK-NEXT: .Llsda_end0: ; Function Attrs: noinline nounwind define internal i32 @"\01?filt$0@0@use_both@@"(i8* %exception_pointers, i8* %frame_pointer) #2 { |