diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-cleanuppad-nounwind.ll | 71 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-cloning.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-demotion.ll | 3 | ||||
-rw-r--r-- | llvm/test/CodeGen/WinEH/wineh-no-demotion.ll | 2 |
4 files changed, 76 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/WinEH/wineh-cleanuppad-nounwind.ll b/llvm/test/CodeGen/WinEH/wineh-cleanuppad-nounwind.ll new file mode 100644 index 00000000000..09b4d3b8a1b --- /dev/null +++ b/llvm/test/CodeGen/WinEH/wineh-cleanuppad-nounwind.ll @@ -0,0 +1,71 @@ +; RUN: opt -S -winehprepare < %s | FileCheck %s +target triple = "x86_64-pc-windows-msvc" + +; CHECK-LABEL: @test1( +define void @test1(i1 %b) personality i32 (...)* @__CxxFrameHandler3 { +entry: + invoke void @f() + to label %try.cont unwind label %cleanup.bb + +; CHECK: entry: + +; CHECK: [[catchswitch_entry:.*]]: +; CHECK-NEXT: %[[cs0:.*]] = catchswitch within none [label %[[catchpad:.*]]] unwind to caller +; CHECK: [[catchpad]]: +; CHECK-NEXT: %[[cp0:.*]] = catchpad within %[[cs0]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: unreachable + +try.cont: + invoke void @f() + to label %exit unwind label %catchswitch.bb + +cleanup.bb: + %cleanup = cleanuppad within none [] + br i1 %b, label %left, label %right + +left: + call void @exit(i32 0) [ "funclet"(token %cleanup) ] + unreachable + +right: + call void @exit(i32 1) [ "funclet"(token %cleanup) ] + unreachable + +catchswitch.bb: + %cs = catchswitch within none [label %catchpad.bb] unwind to caller + +; CHECK: catchpad.bb: +; CHECK-NEXT: %catch = catchpad within %cs [i8* null, i32 64, i8* null] + +; CHECK: [[catchswitch_catch:.*]]: +; CHECK-NEXT: %[[cs1:.*]] = catchswitch within %catch [label %[[catchpad_catch:.*]]] unwind to caller +; CHECK: [[catchpad_catch]]: +; CHECK-NEXT: %[[cp1:.*]] = catchpad within %[[cs1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: unreachable + +; CHECK: nested.cleanup.bb: +; CHECK-NEXT: %nested.cleanup = cleanuppad within %catch [] +; CHECK-NEXT: call void @exit(i32 2) [ "funclet"(token %nested.cleanup) ] +; CHECK-NEXT: cleanupret from %nested.cleanup unwind label %[[catchswitch_catch]] + +catchpad.bb: + %catch = catchpad within %cs [i8* null, i32 64, i8* null] + invoke void @f() [ "funclet"(token %catch) ] + to label %unreachable unwind label %nested.cleanup.bb + +nested.cleanup.bb: + %nested.cleanup = cleanuppad within %catch [] + call void @exit(i32 2) [ "funclet"(token %nested.cleanup) ] + unreachable + +unreachable: + unreachable + +exit: + unreachable +} + +declare void @f() +declare void @exit(i32) nounwind noreturn + +declare i32 @__CxxFrameHandler3(...) diff --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll index 748c07df173..355ffa8c3f6 100644 --- a/llvm/test/CodeGen/WinEH/wineh-cloning.ll +++ b/llvm/test/CodeGen/WinEH/wineh-cloning.ll @@ -44,7 +44,7 @@ noreturn: ; CHECK: call void @llvm.foo(i32 %x) -define void @test2() personality i32 (...)* @__CxxFrameHandler3 { +define void @test2() personality i32 (...)* @__C_specific_handler { entry: invoke void @f() to label %exit unwind label %cleanup @@ -71,7 +71,7 @@ exit: ; CHECK-NEXT: ret void -define void @test3() personality i32 (...)* @__CxxFrameHandler3 { +define void @test3() personality i32 (...)* @__C_specific_handler { entry: invoke void @f() to label %invoke.cont unwind label %catch.switch diff --git a/llvm/test/CodeGen/WinEH/wineh-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-demotion.ll index 411952d84bb..048466a26d1 100644 --- a/llvm/test/CodeGen/WinEH/wineh-demotion.ll +++ b/llvm/test/CodeGen/WinEH/wineh-demotion.ll @@ -1,6 +1,7 @@ ; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -winehprepare < %s | FileCheck %s declare i32 @__CxxFrameHandler3(...) +declare i32 @__C_specific_handler(...) declare void @f() @@ -327,7 +328,7 @@ exit: } ; CHECK-LABEL: @test8( -define void @test8() personality i32 (...)* @__CxxFrameHandler3 { entry: +define void @test8() personality i32 (...)* @__C_specific_handler { entry: invoke void @f() to label %done unwind label %cleanup1 invoke void @f() diff --git a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll index 0901e27c301..277dd5c0e6a 100644 --- a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll +++ b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll @@ -1,4 +1,4 @@ -; RUN: opt -mtriple=x86_x64-pc-windows-msvc -S -winehprepare -disable-demotion -disable-cleanups < %s | FileCheck %s +; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -winehprepare -disable-demotion -disable-cleanups < %s | FileCheck %s declare i32 @__CxxFrameHandler3(...) |