1 // This test checks the alignment and padding of the unwind info. 2 3 // RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | llvm-readobj -s -sd -sr -u | FileCheck %s 4 5 // CHECK: Sections [ 6 // CHECK: Section { 7 // CHECK: Name: .xdata 8 // CHECK: RawDataSize: 16 9 // CHECK: RelocationCount: 1 10 // CHECK: Characteristics [ 11 // CHECK-NEXT: ALIGN_4BYTES 12 // CHECK-NEXT: CNT_INITIALIZED_DATA 13 // CHECK-NEXT: MEM_READ 14 // CHECK-NEXT: ] 15 // CHECK: Relocations [ 16 // CHECK-NEXT: [[HandlerDisp:0x[A-F0-9]+]] IMAGE_REL_AMD64_ADDR32NB __C_specific_handler 17 // CHECK-NEXT: ] 18 // CHECK: SectionData ( 19 // CHECK-NEXT: 0000: 09000100 04220000 00000000 BEBAFECA 20 // CHECK-NEXT: ) 21 // CHECK-NEXT: } 22 // CHECK-NEXT: Section { 23 // CHECK: Name: .pdata 24 // CHECK: RawDataSize: 12 25 // CHECK: RelocationCount: 3 26 // CHECK: Characteristics [ 27 // CHECK-NEXT: IMAGE_SCN_ALIGN_4BYTES 28 // CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA 29 // CHECK-NEXT: IMAGE_SCN_MEM_READ 30 // CHECK-NEXT: ] 31 // CHECK: Relocations [ 32 // CHECK-NEXT: [[BeginDisp:0x[A-F0-9]+]] IMAGE_REL_AMD64_ADDR32NB func 33 // CHECK-NEXT: [[EndDisp:0x[A-F0-9]+]] IMAGE_REL_AMD64_ADDR32NB func 34 // CHECK-NEXT: [[UnwindDisp:0x[A-F0-9]+]] IMAGE_REL_AMD64_ADDR32NB .xdata 35 // CHECK-NEXT: ] 36 // CHECK: SectionData ( 37 // CHECK-NEXT: 0000: FCFFFFFF 05000000 00000000 38 // CHECK-NEXT: ) 39 // CHECK-NEXT: } 40 // CHECK-NEXT: ] 41 // CHECK: UnwindInformation [ 42 // CHECK-NEXT: RuntimeFunction { 43 // CHECK-NEXT: StartAddress: func {{(\+0x[A-F0-9]+ )?}}([[BeginDisp]]) 44 // CHECK-NEXT: EndAddress: func {{(\+0x[A-F0-9]+ )?}}([[EndDisp]]) 45 // CHECK-NEXT: UnwindInfoAddress: .xdata {{(\+0x[A-F0-9]+ )?}}([[UnwindDisp]]) 46 // CHECK-NEXT: UnwindInfo { 47 // CHECK-NEXT: Version: 1 48 // CHECK-NEXT: Flags [ 49 // CHECK-NEXT: ExceptionHandler 50 // CHECK-NEXT: ] 51 // CHECK-NEXT: PrologSize: 0 52 // CHECK-NEXT: FrameRegister: - 53 // CHECK-NEXT: FrameOffset: - 54 // CHECK-NEXT: UnwindCodeCount: 1 55 // CHECK-NEXT: UnwindCodes [ 56 // CHECK-NEXT: 0x04: ALLOC_SMALL size=24 57 // CHECK-NEXT: ] 58 // CHECK-NEXT: Handler: __C_specific_handler ([[HandlerDisp]]) 59 // CHECK-NEXT: } 60 // CHECK-NEXT: } 61 // CHECK-NEXT: ] 62 63 // Generates only one unwind code. 64 // Requires padding of the unwind code array. 65 .globl func 66 .def func; .scl 2; .type 32; .endef 67 .seh_proc func 68 subq $24, %rsp 69 .seh_stackalloc 24 70 .seh_handler __C_specific_handler, @except 71 .seh_handlerdata 72 .long 0xcafebabe 73 .text 74 .seh_endprologue 75 func: 76 addq $24, %rsp 77 ret 78 .seh_endproc 79