127 lines · plain
1; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=X642; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s --check-prefix=X863 4declare void @throw()5 6declare i32 @__CxxFrameHandler3(...)7 8declare void @llvm.trap()9 10define void @test1() personality ptr @__CxxFrameHandler3 {11entry:12 %alloca2 = alloca ptr, align 413 %alloca1 = alloca ptr, align 414 store volatile ptr null, ptr %alloca115 invoke void @throw()16 to label %unreachable unwind label %catch.dispatch17 18; X64-LABEL: test1:19; X64: movq $0, -8(%rbp)20; X64: callq throw21 22; X86-LABEL: _test1:23; X86: pushl %ebp24; X86: movl %esp, %ebp25; X86: pushl %ebx26; X86: pushl %edi27; X86: pushl %esi28; X86: subl $20, %esp29 30; X86: movl $0, -32(%ebp)31; X86: calll _throw32 33catch.dispatch: ; preds = %entry34 %cs = catchswitch within none [label %catch.pad] unwind to caller35 36catch.pad: ; preds = %catch.dispatch37 %cp = catchpad within %cs [ptr null, i32 0, ptr %alloca1]38 %v = load volatile ptr, ptr %alloca139 store volatile ptr null, ptr %alloca140 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %alloca1)41 call void @llvm.lifetime.start.p0(i64 4, ptr %alloca2)42 store volatile ptr null, ptr %alloca143 call void @llvm.trap()44 unreachable45 46; X64-LABEL: "?catch$2@?0?test1@4HA"47; X64: movq $0, -8(%rbp)48; X64: movq $0, -8(%rbp)49; X64: ud250 51; X86-LABEL: "?catch$2@?0?test1@4HA"52; X86: movl $0, -32(%ebp)53; X86: movl $0, -32(%ebp)54; X86: ud255 56unreachable: ; preds = %entry57 unreachable58}59 60; X64-LABEL: $cppxdata$test1:61; X64: .long 40 # CatchObjOffset62 63; -20 is difference between the end of the EH reg node stack object and the64; catch object at EBP -32.65; X86-LABEL: L__ehtable$test1:66; X86: .long -20 # CatchObjOffset67 68define void @test2() personality ptr @__CxxFrameHandler3 {69entry:70 %alloca2 = alloca ptr, align 471 %alloca1 = alloca ptr, align 472 store volatile ptr null, ptr %alloca173 invoke void @throw()74 to label %unreachable unwind label %catch.dispatch75 76; X64-LABEL: test2:77; X64: movq $0, -16(%rbp)78; X64: callq throw79 80; X86-LABEL: _test2:81; X86: movl $0, -32(%ebp)82; X86: calll _throw83 84 85catch.dispatch: ; preds = %entry86 %cs = catchswitch within none [label %catch.pad] unwind to caller87 88catch.pad: ; preds = %catch.dispatch89 %cp = catchpad within %cs [ptr null, i32 0, ptr null]90 store volatile ptr null, ptr %alloca191 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %alloca1)92 call void @llvm.lifetime.start.p0(i64 4, ptr %alloca2)93 store volatile ptr null, ptr %alloca194 call void @llvm.trap()95 unreachable96 97; X64-LABEL: "?catch$2@?0?test2@4HA"98; X64: movq $0, -16(%rbp)99; X64: movq $0, -16(%rbp)100; X64: ud2101 102; X86-LABEL: "?catch$2@?0?test2@4HA"103; X86: movl $0, -32(%ebp)104; X86: movl $0, -32(%ebp)105; X86: ud2106 107 108unreachable: ; preds = %entry109 unreachable110}111 112; X64-LABEL: $cppxdata$test2:113; X64: .long 0 # CatchObjOffset114 115 116; X86-LABEL: L__ehtable$test2:117; X86: .long 0 # CatchObjOffset118 119 120; Function Attrs: argmemonly nounwind121declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #0122 123; Function Attrs: argmemonly nounwind124declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #0125 126attributes #0 = { argmemonly nounwind }127