1; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=X64 2; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s --check-prefix=X86 3 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 4 13 %alloca1 = alloca ptr, align 4 14 store volatile ptr null, ptr %alloca1 15 invoke void @throw() 16 to label %unreachable unwind label %catch.dispatch 17 18; X64-LABEL: test1: 19; X64: movq $0, -8(%rbp) 20; X64: callq throw 21 22; X86-LABEL: _test1: 23; X86: pushl %ebp 24; X86: movl %esp, %ebp 25; X86: pushl %ebx 26; X86: pushl %edi 27; X86: pushl %esi 28; X86: subl $20, %esp 29 30; X86: movl $0, -32(%ebp) 31; X86: calll _throw 32 33catch.dispatch: ; preds = %entry 34 %cs = catchswitch within none [label %catch.pad] unwind to caller 35 36catch.pad: ; preds = %catch.dispatch 37 %cp = catchpad within %cs [ptr null, i32 0, ptr %alloca1] 38 %v = load volatile ptr, ptr %alloca1 39 store volatile ptr null, ptr %alloca1 40 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 %alloca1 43 call void @llvm.trap() 44 unreachable 45 46; X64-LABEL: "?catch$2@?0?test1@4HA" 47; X64: movq $0, -8(%rbp) 48; X64: movq $0, -8(%rbp) 49; X64: ud2 50 51; X86-LABEL: "?catch$2@?0?test1@4HA" 52; X86: movl $0, -32(%ebp) 53; X86: movl $0, -32(%ebp) 54; X86: ud2 55 56unreachable: ; preds = %entry 57 unreachable 58} 59 60; X64-LABEL: $cppxdata$test1: 61; X64: .long 40 # CatchObjOffset 62 63; -20 is difference between the end of the EH reg node stack object and the 64; catch object at EBP -32. 65; X86-LABEL: L__ehtable$test1: 66; X86: .long -20 # CatchObjOffset 67 68define void @test2() personality ptr @__CxxFrameHandler3 { 69entry: 70 %alloca2 = alloca ptr, align 4 71 %alloca1 = alloca ptr, align 4 72 store volatile ptr null, ptr %alloca1 73 invoke void @throw() 74 to label %unreachable unwind label %catch.dispatch 75 76; X64-LABEL: test2: 77; X64: movq $0, -16(%rbp) 78; X64: callq throw 79 80; X86-LABEL: _test2: 81; X86: movl $0, -32(%ebp) 82; X86: calll _throw 83 84 85catch.dispatch: ; preds = %entry 86 %cs = catchswitch within none [label %catch.pad] unwind to caller 87 88catch.pad: ; preds = %catch.dispatch 89 %cp = catchpad within %cs [ptr null, i32 0, ptr null] 90 store volatile ptr null, ptr %alloca1 91 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 %alloca1 94 call void @llvm.trap() 95 unreachable 96 97; X64-LABEL: "?catch$2@?0?test2@4HA" 98; X64: movq $0, -16(%rbp) 99; X64: movq $0, -16(%rbp) 100; X64: ud2 101 102; X86-LABEL: "?catch$2@?0?test2@4HA" 103; X86: movl $0, -32(%ebp) 104; X86: movl $0, -32(%ebp) 105; X86: ud2 106 107 108unreachable: ; preds = %entry 109 unreachable 110} 111 112; X64-LABEL: $cppxdata$test2: 113; X64: .long 0 # CatchObjOffset 114 115 116; X86-LABEL: L__ehtable$test2: 117; X86: .long 0 # CatchObjOffset 118 119 120; Function Attrs: argmemonly nounwind 121declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #0 122 123; Function Attrs: argmemonly nounwind 124declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #0 125 126attributes #0 = { argmemonly nounwind } 127