1 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4 target triple = "x86_64-pc-windows-msvc"
8 declare i32 @__CxxFrameHandler3(...)
10 declare void @llvm.trap()
12 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
14 %alloca2 = alloca i8*, align 4
15 %alloca1 = alloca i8*, align 4
16 store volatile i8* null, i8** %alloca1
18 to label %unreachable unwind label %catch.dispatch
21 ; CHECK: movq $0, -8(%rbp)
24 catch.dispatch: ; preds = %entry
25 %cs = catchswitch within none [label %catch.pad] unwind to caller
27 catch.pad: ; preds = %catch.dispatch
28 %cp = catchpad within %cs [i8* null, i32 0, i8** %alloca1]
29 store volatile i8* null, i8** %alloca1
30 %bc1 = bitcast i8** %alloca1 to i8*
31 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %bc1)
32 %bc2 = bitcast i8** %alloca2 to i8*
33 call void @llvm.lifetime.start.p0i8(i64 4, i8* %bc2)
34 store volatile i8* null, i8** %alloca1
35 call void @llvm.trap()
38 ; CHECK-LABEL: "?catch$2@?0?test1@4HA"
39 ; CHECK: movq $0, -8(%rbp)
40 ; CHECK: movq $0, -8(%rbp)
43 unreachable: ; preds = %entry
47 ; CHECK-LABEL: $cppxdata$test1:
48 ; CHECK: .long 56 # CatchObjOffset
50 define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
52 %alloca2 = alloca i8*, align 4
53 %alloca1 = alloca i8*, align 4
54 store volatile i8* null, i8** %alloca1
56 to label %unreachable unwind label %catch.dispatch
59 ; CHECK: movq $0, -16(%rbp)
62 catch.dispatch: ; preds = %entry
63 %cs = catchswitch within none [label %catch.pad] unwind to caller
65 catch.pad: ; preds = %catch.dispatch
66 %cp = catchpad within %cs [i8* null, i32 0, i8** null]
67 store volatile i8* null, i8** %alloca1
68 %bc1 = bitcast i8** %alloca1 to i8*
69 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %bc1)
70 %bc2 = bitcast i8** %alloca2 to i8*
71 call void @llvm.lifetime.start.p0i8(i64 4, i8* %bc2)
72 store volatile i8* null, i8** %alloca1
73 call void @llvm.trap()
76 ; CHECK-LABEL: "?catch$2@?0?test2@4HA"
77 ; CHECK: movq $0, -16(%rbp)
78 ; CHECK: movq $0, -16(%rbp)
81 unreachable: ; preds = %entry
85 ; CHECK-LABEL: $cppxdata$test2:
86 ; CHECK: .long 0 # CatchObjOffset
89 ; Function Attrs: argmemonly nounwind
90 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #0
92 ; Function Attrs: argmemonly nounwind
93 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
95 attributes #0 = { argmemonly nounwind }