diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-03-11 23:22:06 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-03-11 23:22:06 +0000 |
| commit | 6b67d4277366cbaa0b76b544b94ebafab26e502a (patch) | |
| tree | dd6a56a77fa213f1f967eb9939216f48789f0466 /llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll | |
| parent | 5f141b03fa622e6c2992b3c0b855a297f585dc0d (diff) | |
| download | bcm5719-llvm-6b67d4277366cbaa0b76b544b94ebafab26e502a.tar.gz bcm5719-llvm-6b67d4277366cbaa0b76b544b94ebafab26e502a.zip | |
Extended support for native Windows C++ EH outlining
Differential Review: http://reviews.llvm.org/D7886
llvm-svn: 231981
Diffstat (limited to 'llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll')
| -rw-r--r-- | llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll b/llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll index abdbc3826c5..89562d7125b 100644 --- a/llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll +++ b/llvm/test/CodeGen/WinEH/cppeh-min-unwind.ll @@ -23,11 +23,11 @@ target triple = "x86_64-pc-windows-msvc" ; The function entry should be rewritten like this. ; CHECK: define void @_Z4testv() #0 { ; CHECK: entry: -; CHECK: %obj = alloca %class.SomeClass, align 4 -; CHECK: call void @_ZN9SomeClassC1Ev(%class.SomeClass* %obj) -; CHECK: call void (...)* @llvm.frameescape(%class.SomeClass* %obj) +; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass, align 4 +; CHECK: call void @_ZN9SomeClassC1Ev(%class.SomeClass* [[OBJ_PTR]]) +; CHECK: call void (...)* @llvm.frameescape(%class.SomeClass* [[OBJ_PTR]]) ; CHECK: invoke void @_Z9may_throwv() -; CHECK: to label %invoke.cont unwind label %lpad +; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]+]] ; Function Attrs: uwtable define void @_Z4testv() #0 { @@ -43,6 +43,17 @@ invoke.cont: ; preds = %entry call void @_ZN9SomeClassD1Ev(%class.SomeClass* %obj) ret void +; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry +; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: cleanup +; CHECK-NOT: extractvalue { i8*, i32 } +; CHECK-NOT: store i8* +; CHECK-NOT: store i32 +; CHECK-NOT: call void @_ZN9SomeClassD1Ev +; CHECK-NOT: br label %eh.resume +; CHECK: [[RECOVER:\%.+]] = call i8* (...)* @llvm.eh.actions({ i8*, i32 } [[LPAD_VAL]], i32 1, i8* bitcast (void (i8*, i8*)* @_Z4testv.cleanup to i8*)) +; CHECK: indirectbr i8* [[RECOVER]], [] + lpad: ; preds = %entry %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) cleanup @@ -53,20 +64,24 @@ lpad: ; preds = %entry call void @_ZN9SomeClassD1Ev(%class.SomeClass* %obj) br label %eh.resume +; CHECK-NOT: eh.resume: + eh.resume: ; preds = %lpad %exn = load i8*, i8** %exn.slot %sel = load i32, i32* %ehselector.slot %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val2 + +; CHECK: } } ; This cleanup handler should be outlined. ; CHECK: define internal void @_Z4testv.cleanup(i8*, i8*) { ; CHECK: entry: -; CHECK: %obj.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @_Z4testv to i8*), i8* %1, i32 0) -; CHECK: %obj = bitcast i8* %obj.i8 to %class.SomeClass* -; CHECK: call void @_ZN9SomeClassD1Ev(%class.SomeClass* %obj) +; CHECK: [[RECOVER_OBJ:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @_Z4testv to i8*), i8* %1, i32 0) +; CHECK: [[OBJ_PTR1:\%.+]] = bitcast i8* [[RECOVER_OBJ]] to %class.SomeClass* +; CHECK: call void @_ZN9SomeClassD1Ev(%class.SomeClass* [[OBJ_PTR1]]) ; CHECK: ret void ; CHECK: } |

