1 ; RUN: opt < %s -instcombine -S | FileCheck %s
2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-windows-msvc18.0.0"
5 declare i32 @__CxxFrameHandler3(...)
7 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
12 %cl = cleanuppad within none []
13 cleanupret from %cl unwind to caller
16 ; CHECK-LABEL: define void @test1(
18 ; CHECK: %cl = cleanuppad within none []
19 ; CHECK: cleanupret from %cl unwind to caller
21 define void @test2(i8 %A, i8 %B) personality i32 (...)* @__CxxFrameHandler3 {
23 %X = zext i8 %A to i32
29 %Y = zext i8 %B to i32
35 %phi = phi i32 [ %X, %bb ], [ %Y, %cont ]
36 %cs = catchswitch within none [label %doit] unwind to caller
39 %cl = catchpad within %cs []
40 call void @g(i32 %phi)
47 ; CHECK-LABEL: define void @test2(
48 ; CHECK: %X = zext i8 %A to i32
49 ; CHECK: %Y = zext i8 %B to i32
50 ; CHECK: %phi = phi i32 [ %X, %bb ], [ %Y, %cont ]
52 define void @test3(i8 %A, i8 %B) personality i32 (...)* @__CxxFrameHandler3 {
54 %X = zext i8 %A to i32
60 %Y = zext i8 %B to i32
71 %phi = phi i32 [ %X, %bb ], [ %Y, %cont ], [ %Y, %cont2 ]
72 %cs = catchswitch within none [label %doit] unwind to caller
75 %cl = catchpad within %cs []
76 call void @g(i32 %phi)
83 ; CHECK-LABEL: define void @test3(
84 ; CHECK: %X = zext i8 %A to i32
85 ; CHECK: %Y = zext i8 %B to i32
86 ; CHECK: %phi = phi i32 [ %X, %bb ], [ %Y, %cont ], [ %Y, %cont2 ]
89 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
91 define void @test4(i8 addrspace(1)* %obj) gc "statepoint-example" {
96 call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
100 ; CHECK-LABEL: define void @test4(
101 ; CHECK: unreachable:
102 ; CHECK: call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)