1 // This test checks that the SEH directives emit the correct unwind data. 2 // RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | coff-dump.py | FileCheck %s 3 4 // CHECK: Name = .xdata 5 // CHECK-NEXT: VirtualSize 6 // CHECK-NEXT: VirtualAddress 7 // CHECK-NEXT: SizeOfRawData = 52 8 // CHECK-NEXT: PointerToRawData 9 // CHECK-NEXT: PointerToRelocations 10 // CHECK-NEXT: PointerToLineNumbers 11 // CHECK-NEXT: NumberOfRelocations = 4 12 // CHECK-NEXT: NumberOfLineNumbers = 0 13 // CHECK-NEXT: Charateristics 14 // CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA 15 // CHECK-NEXT: IMAGE_SCN_ALIGN_4BYTES 16 // CHECK-NEXT: IMAGE_SCN_MEM_READ 17 // CHECK-NEXT: IMAGE_SCN_MEM_WRITE 18 // CHECK-NEXT: SectionData 19 // CHECK-NEXT: 09 12 08 03 00 03 0F 30 - 0E 88 00 00 09 64 02 00 20 // CHECK-NEXT: 04 22 00 1A 00 00 00 00 - 00 00 00 00 21 00 00 00 21 // CHECK-NEXT: 00 00 00 00 1B 00 00 00 - 00 00 00 00 01 00 00 00 22 // CHECK-NEXT: 00 00 00 00 23 24 .text 25 .globl func 26 .def func; .scl 2; .type 32; .endef 27 .seh_proc func 28 func: 29 .seh_pushframe @code 30 subq $24, %rsp 31 .seh_stackalloc 24 32 movq %rsi, 16(%rsp) 33 .seh_savereg %rsi, 16 34 movups %xmm8, (%rsp) 35 .seh_savexmm %xmm8, 0 36 pushq %rbx 37 .seh_pushreg 3 38 mov %rsp, %rbx 39 .seh_setframe 3, 0 40 .seh_endprologue 41 .seh_handler __C_specific_handler, @except 42 .seh_handlerdata 43 .long 0 44 .text 45 .seh_startchained 46 .seh_endprologue 47 .seh_endchained 48 lea (%rbx), %rsp 49 pop %rbx 50 addq $24, %rsp 51 ret 52 .seh_endproc 53 54 // Test emission of small functions. 55 .globl smallFunc 56 .def smallFunc; .scl 2; .type 32; .endef 57 .seh_proc smallFunc 58 smallFunc: 59 ret 60 .seh_endproc 61