brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.9 KiB · 18546b8 Raw
281 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=i686-pc-windows-msvc < %s | FileCheck --check-prefix=X86 %s2; RUN: llc -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc < %s | FileCheck --check-prefix=X64 %s3 4%rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] }5%eh.CatchableType = type { i32, ptr, i32, i32, i32, i32, ptr }6%eh.CatchableTypeArray.1 = type { i32, [1 x ptr] }7%eh.ThrowInfo = type { i32, ptr, ptr, ptr }8 9$"\01??_R0H@8" = comdat any10 11@"\01??_7type_info@@6B@" = external constant ptr12@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { ptr @"\01??_7type_info@@6B@", ptr null, [3 x i8] c".H\00" }, comdat13 14declare i32 @getint()15declare void @useints(...)16declare void @f(i32 %p)17declare i32 @__CxxFrameHandler3(...)18 19define i32 @try_catch_catch() personality ptr @__CxxFrameHandler3 {20entry:21  %a = call i32 @getint()22  %b = call i32 @getint()23  %c = call i32 @getint()24  %d = call i32 @getint()25  call void (...) @useints(i32 %a, i32 %b, i32 %c, i32 %d)26  invoke void @f(i32 1)27          to label %try.cont unwind label %catch.dispatch28 29try.cont:30  ret i32 031 32catch.dispatch:33  %cs = catchswitch within none [label %handler1] unwind to caller34 35handler1:36  %h1 = catchpad within %cs [ptr @"\01??_R0H@8", i32 0, ptr null]37  call void @f(i32 2) [ "funclet"(token %h1) ]38  catchret from %h1 to label %try.cont39}40 41; X86-LABEL: _try_catch_catch:42; X86: pushl %ebp43; X86: movl %esp, %ebp44; X86: pushl %ebx45; X86: pushl %edi46; X86: pushl %esi47; X86: subl ${{[0-9]+}}, %esp48; X86: calll _getint49; X86: calll _getint50; X86: calll _getint51; X86: calll _getint52; X86: calll _useints53; X86: movl $0, -{{[0-9]+}}(%ebp)54; X86: pushl $155; X86: calll _f56; X86: [[contbb:LBB0_[0-9]+]]: # %try.cont57; X86: popl %esi58; X86: popl %edi59; X86: popl %ebx60; X86: popl %ebp61; X86: retl62 63; X86: [[restorebb:LBB0_[0-9]+]]:64; X86: addl $12, %ebp65; X86: jmp [[contbb]]66 67; X86: "?catch$[[catch1bb:[0-9]+]]@?0?try_catch_catch@4HA":68; X86: LBB0_[[catch1bb]]: # %handler1{{$}}69; X86: pushl %ebp70; X86-NOT: pushl71; X86: subl $16, %esp72; X86: addl $12, %ebp73; X86: movl $1, -{{[0-9]+}}(%ebp)74; X86: pushl $275; X86: calll _f76; X86: movl $[[restorebb]], %eax77; X86-NEXT: addl $16, %esp78; X86-NEXT: popl %ebp79; X86-NEXT: retl80 81; X86: L__ehtable$try_catch_catch:82; X86: $handlerMap$0$try_catch_catch:83; X86:   .long   084; X86:   .long   "??_R0H@8"85; X86:   .long   086; X86:   .long   "?catch$[[catch1bb]]@?0?try_catch_catch@4HA"87 88; X64-LABEL: try_catch_catch:89; X64: pushq %rbp90; X64: .seh_pushreg %rbp91; X64: pushq %rsi92; X64: .seh_pushreg %rsi93; X64: pushq %rdi94; X64: .seh_pushreg %rdi95; X64: pushq %rbx96; X64: .seh_pushreg %rbx97; X64: subq $40, %rsp98; X64: .seh_stackalloc 4099; X64: leaq 32(%rsp), %rbp100; X64: .seh_setframe %rbp, 32101; X64: .seh_endprologue102; X64: movq $-2, (%rbp)103; X64: callq getint104; X64: callq getint105; X64: callq getint106; X64: callq getint107; X64: callq useints108; X64: movl $1, %ecx109; X64: callq f110; X64: [[contbb:\.LBB0_[0-9]+]]: # Block address taken111; X64-NEXT:                      # %try.cont112; X64: .seh_startepilogue113; X64: addq $40, %rsp114; X64: popq %rbp115; X64: .seh_endepilogue116; X64: retq117 118; X64: "?catch$[[catch1bb:[0-9]+]]@?0?try_catch_catch@4HA":119; X64: LBB0_[[catch1bb]]: # %handler1{{$}}120; X64: movq %rdx, 16(%rsp)121; X64: pushq %rbp122; X64: .seh_pushreg %rbp123; X64: pushq %rsi124; X64: .seh_pushreg %rsi125; X64: pushq %rdi126; X64: .seh_pushreg %rdi127; X64: pushq %rbx128; X64: .seh_pushreg %rbx129; X64: subq $40, %rsp130; X64: .seh_stackalloc 40131; X64: leaq 32(%rdx), %rbp132; X64: .seh_endprologue133; X64: movl $2, %ecx134; X64: callq f135; X64: leaq [[contbb]](%rip), %rax136; X64: .seh_startepilogue137; X64: addq $40, %rsp138; X64: popq %rbx139; X64: popq %rdi140; X64: popq %rsi141; X64: popq %rbp142; X64: .seh_endepilogue143; X64: retq144 145; X64: $handlerMap$0$try_catch_catch:146; X64:   .long   0147; X64:   .long   "??_R0H@8"@IMGREL148; X64:   .long   0149; X64:   .long   "?catch$[[catch1bb]]@?0?try_catch_catch@4HA"@IMGREL150; X64:   .long   88151 152define i32 @try_one_csr() personality ptr @__CxxFrameHandler3 {153entry:154  %a = call i32 @getint()155  %b = call i32 @getint()156  call void (...) @useints(i32 %a)157  invoke void @f(i32 1)158          to label %try.cont unwind label %catch.dispatch159 160catch.dispatch:161  %cs = catchswitch within none [label %handler1] unwind to caller162 163handler1:164  %0 = catchpad within %cs [ptr @"\01??_R0H@8", i32 0, ptr null]165  catchret from %0 to label %try.cont166 167try.cont:168  ret i32 0169}170 171; X64-LABEL: try_one_csr:172; X64: pushq %rbp173; X64: .seh_pushreg %rbp174; X64: pushq %rsi175; X64: .seh_pushreg %rsi176; X64-NOT: pushq177; X64: subq $40, %rsp178; X64: .seh_stackalloc 40179; X64: leaq 32(%rsp), %rbp180; X64: .seh_setframe %rbp, 32181; X64: .seh_endprologue182; X64: callq getint183; X64: callq getint184; X64: callq useints185; X64: movl $1, %ecx186; X64: callq f187; X64: [[contbb:\.LBB1_[0-9]+]]: # Block address taken188; X64-NEXT:                      # %try.cont189; X64: .seh_startepilogue190; X64: addq $40, %rsp191; X64-NOT: popq192; X64: popq %rsi193; X64: popq %rbp194; X64: .seh_endepilogue195; X64: retq196 197; X64: "?catch$[[catch1bb:[0-9]+]]@?0?try_one_csr@4HA":198; X64: LBB1_[[catch1bb]]: # %handler1{{$}}199; X64: movq %rdx, 16(%rsp)200; X64: pushq %rbp201; X64: .seh_pushreg %rbp202; X64: pushq %rsi203; X64: .seh_pushreg %rsi204; X64: subq $40, %rsp205; X64: .seh_stackalloc 40206; X64: leaq 32(%rdx), %rbp207; X64: .seh_endprologue208; X64: leaq [[contbb]](%rip), %rax209; X64: .seh_startepilogue210; X64: addq $40, %rsp211; X64: popq %rsi212; X64: popq %rbp213; X64: .seh_endepilogue214; X64: retq215 216; X64: $handlerMap$0$try_one_csr:217; X64:   .long   0218; X64:   .long   "??_R0H@8"@IMGREL219; X64:   .long   0220; X64:   .long   "?catch$[[catch1bb]]@?0?try_one_csr@4HA"@IMGREL221; X64:   .long   72222 223define i32 @try_no_csr() personality ptr @__CxxFrameHandler3 {224entry:225  invoke void @f(i32 1)226          to label %try.cont unwind label %catch.dispatch227 228catch.dispatch:229  %cs = catchswitch within none [label %handler1] unwind to caller230 231handler1:232  %cp1 = catchpad within %cs [ptr @"\01??_R0H@8", i32 0, ptr null]233  catchret from %cp1 to label %try.cont234 235try.cont:236  ret i32 0237}238 239; X64-LABEL: try_no_csr:240; X64: pushq %rbp241; X64: .seh_pushreg %rbp242; X64-NOT: pushq243; X64: subq $48, %rsp244; X64: .seh_stackalloc 48245; X64: leaq 48(%rsp), %rbp246; X64: .seh_setframe %rbp, 48247; X64: .seh_endprologue248; X64: movl $1, %ecx249; X64: callq f250; X64: [[contbb:\.LBB2_[0-9]+]]: # Block address taken251; X64-NEXT:                      # %try.cont252; X64: .seh_startepilogue253; X64: addq $48, %rsp254; X64-NOT: popq255; X64: popq %rbp256; X64: .seh_endepilogue257; X64: retq258 259; X64: "?catch$[[catch1bb:[0-9]+]]@?0?try_no_csr@4HA":260; X64: LBB2_[[catch1bb]]: # %handler1{{$}}261; X64: movq %rdx, 16(%rsp)262; X64: pushq %rbp263; X64: .seh_pushreg %rbp264; X64: subq $32, %rsp265; X64: .seh_stackalloc 32266; X64: leaq 48(%rdx), %rbp267; X64: .seh_endprologue268; X64: leaq [[contbb]](%rip), %rax269; X64: .seh_startepilogue270; X64: addq $32, %rsp271; X64: popq %rbp272; X64: .seh_endepilogue273; X64: retq274 275; X64: $handlerMap$0$try_no_csr:276; X64:   .long   0277; X64:   .long   "??_R0H@8"@IMGREL278; X64:   .long   0279; X64:   .long   "?catch$[[catch1bb]]@?0?try_no_csr@4HA"@IMGREL280; X64:   .long   56281