|
| 1 | +# RUN: llvm-mc %s -triple x86_64-windows-msvc -filetype=obj -o %t.obj |
| 2 | +# RUN: lld-link %t.obj -dll -noentry -out:%t.dll |
| 3 | +# RUN: llvm-readobj -sections %t.dll | FileCheck %s |
| 4 | + |
| 5 | +# There shouldn't be much xdata, because all three .pdata entries (12 bytes |
| 6 | +# each) should use the same .xdata unwind info. |
| 7 | +# CHECK: Name: .pdata |
| 8 | +# CHECK-NEXT: VirtualSize: 0x24 |
| 9 | +# CHECK: Name: .xdata |
| 10 | +# CHECK-NEXT: VirtualSize: 0x8 |
| 11 | + |
| 12 | + .text |
| 13 | +callee: |
| 14 | + ret |
| 15 | + |
| 16 | + .def xdata1; |
| 17 | + .scl 2; |
| 18 | + .type 32; |
| 19 | + .endef |
| 20 | + .section .text,"xr",one_only,xdata1 |
| 21 | + .globl xdata1 # -- Begin function xdata1 |
| 22 | + .p2align 4, 0x90 |
| 23 | +xdata1: # @xdata1 |
| 24 | +.seh_proc xdata1 |
| 25 | +# BB#0: # %entry |
| 26 | + subq $40, %rsp |
| 27 | + .seh_stackalloc 40 |
| 28 | + .seh_endprologue |
| 29 | + callq callee |
| 30 | + nop |
| 31 | + addq $40, %rsp |
| 32 | + jmp callee # TAILCALL |
| 33 | + .seh_handlerdata |
| 34 | + .section .text,"xr",one_only,xdata1 |
| 35 | + .seh_endproc |
| 36 | + # -- End function |
| 37 | + .def xdata2; |
| 38 | + .scl 2; |
| 39 | + .type 32; |
| 40 | + .endef |
| 41 | + .section .text,"xr",one_only,xdata2 |
| 42 | + .globl xdata2 # -- Begin function xdata2 |
| 43 | + .p2align 4, 0x90 |
| 44 | +xdata2: # @xdata2 |
| 45 | +.seh_proc xdata2 |
| 46 | +# BB#0: # %entry |
| 47 | + subq $40, %rsp |
| 48 | + .seh_stackalloc 40 |
| 49 | + .seh_endprologue |
| 50 | + callq callee |
| 51 | + callq callee |
| 52 | + nop |
| 53 | + addq $40, %rsp |
| 54 | + jmp callee # TAILCALL |
| 55 | + .seh_handlerdata |
| 56 | + .section .text,"xr",one_only,xdata2 |
| 57 | + .seh_endproc |
| 58 | + # -- End function |
| 59 | + .def xdata3; |
| 60 | + .scl 2; |
| 61 | + .type 32; |
| 62 | + .endef |
| 63 | + .section .text,"xr",one_only,xdata3 |
| 64 | + .globl xdata3 # -- Begin function xdata3 |
| 65 | + .p2align 4, 0x90 |
| 66 | +xdata3: # @xdata3 |
| 67 | +.seh_proc xdata3 |
| 68 | +# BB#0: # %entry |
| 69 | + subq $40, %rsp |
| 70 | + .seh_stackalloc 40 |
| 71 | + .seh_endprologue |
| 72 | + callq callee |
| 73 | + callq callee |
| 74 | + callq callee |
| 75 | + nop |
| 76 | + addq $40, %rsp |
| 77 | + jmp callee # TAILCALL |
| 78 | + .seh_handlerdata |
| 79 | + .section .text,"xr",one_only,xdata3 |
| 80 | + .seh_endproc |
| 81 | + # -- End function |
| 82 | + .section .drectve,"yn" |
| 83 | + .ascii " -export:xdata1" |
| 84 | + .ascii " -export:xdata2" |
| 85 | + .ascii " -export:xdata3" |
| 86 | + |
0 commit comments