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 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
12 %alloca2 = alloca i8*, align 4
13 %alloca1 = alloca i8*, align 4
14 store volatile i8* null, i8** %alloca1
16 to label %unreachable unwind label %catch.dispatch
19 ; CHECK: movq $0, -8(%rbp)
22 catch.dispatch: ; preds = %entry
23 %cs = catchswitch within none [label %catch.pad] unwind to caller
25 catch.pad: ; preds = %catch.dispatch
26 %cp = catchpad within %cs [i8* null, i32 0, i8** %alloca1]
27 store volatile i8* null, i8** %alloca1
28 %bc1 = bitcast i8** %alloca1 to i8*
29 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %bc1)
30 %bc2 = bitcast i8** %alloca2 to i8*
31 call void @llvm.lifetime.start.p0i8(i64 4, i8* %bc2)
32 store volatile i8* null, i8** %alloca1
35 ; CHECK-LABEL: "?catch$2@?0?test1@4HA"
36 ; CHECK: movq $0, -8(%rbp)
37 ; CHECK: movq $0, -8(%rbp)
40 unreachable: ; preds = %entry
44 ; CHECK-LABEL: $cppxdata$test1:
45 ; CHECK: .long 56 # CatchObjOffset
47 define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
49 %alloca2 = alloca i8*, align 4
50 %alloca1 = alloca i8*, align 4
51 store volatile i8* null, i8** %alloca1
53 to label %unreachable unwind label %catch.dispatch
56 ; CHECK: movq $0, -16(%rbp)
59 catch.dispatch: ; preds = %entry
60 %cs = catchswitch within none [label %catch.pad] unwind to caller
62 catch.pad: ; preds = %catch.dispatch
63 %cp = catchpad within %cs [i8* null, i32 0, i8** null]
64 store volatile i8* null, i8** %alloca1
65 %bc1 = bitcast i8** %alloca1 to i8*
66 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %bc1)
67 %bc2 = bitcast i8** %alloca2 to i8*
68 call void @llvm.lifetime.start.p0i8(i64 4, i8* %bc2)
69 store volatile i8* null, i8** %alloca1
72 ; CHECK-LABEL: "?catch$2@?0?test2@4HA"
73 ; CHECK: movq $0, -16(%rbp)
74 ; CHECK: movq $0, -16(%rbp)
77 unreachable: ; preds = %entry
81 ; CHECK-LABEL: $cppxdata$test2:
82 ; CHECK: .long 0 # CatchObjOffset
85 ; Function Attrs: argmemonly nounwind
86 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #0
88 ; Function Attrs: argmemonly nounwind
89 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
91 attributes #0 = { argmemonly nounwind }