• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This test ensures functions in custom sections get unwind info emitted in a
2// distinct .xdata section.
3// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -s -sd | FileCheck %s
4
5// CHECK:      Name: .xdata
6// CHECK-NEXT: VirtualSize
7// CHECK-NEXT: VirtualAddress
8// CHECK-NEXT: RawDataSize: 8
9// CHECK-NEXT: PointerToRawData
10// CHECK-NEXT: PointerToRelocations
11// CHECK-NEXT: PointerToLineNumbers
12// CHECK-NEXT: RelocationCount: 0
13// CHECK-NEXT: LineNumberCount: 0
14// CHECK-NEXT: Characteristics [
15// CHECK-NEXT:   IMAGE_SCN_ALIGN_4BYTES
16// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
17// CHECK-NEXT:   IMAGE_SCN_MEM_READ
18// CHECK-NEXT: ]
19// CHECK-NEXT: SectionData (
20// CHECK-NEXT:   0000: 01050200 05500402
21// CHECK-NEXT: )
22
23// CHECK:      Name: .xdata
24// CHECK-NEXT: VirtualSize
25// CHECK-NEXT: VirtualAddress
26// CHECK-NEXT: RawDataSize: 8
27// CHECK-NEXT: PointerToRawData
28// CHECK-NEXT: PointerToRelocations
29// CHECK-NEXT: PointerToLineNumbers
30// CHECK-NEXT: RelocationCount: 0
31// CHECK-NEXT: LineNumberCount: 0
32// CHECK-NEXT: Characteristics [
33// CHECK-NEXT:   IMAGE_SCN_ALIGN_4BYTES
34// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
35// CHECK-NEXT:   IMAGE_SCN_MEM_READ
36// CHECK-NEXT: ]
37// CHECK-NEXT: SectionData (
38// CHECK-NEXT:   0000: 01050200 05500402
39// CHECK-NEXT: )
40
41// CHECK:      Name: .xdata
42// CHECK-NEXT: VirtualSize
43// CHECK-NEXT: VirtualAddress
44// CHECK-NEXT: RawDataSize: 8
45// CHECK-NEXT: PointerToRawData
46// CHECK-NEXT: PointerToRelocations
47// CHECK-NEXT: PointerToLineNumbers
48// CHECK-NEXT: RelocationCount: 0
49// CHECK-NEXT: LineNumberCount: 0
50// CHECK-NEXT: Characteristics [
51// CHECK-NEXT:   IMAGE_SCN_ALIGN_4BYTES
52// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
53// CHECK-NEXT:   IMAGE_SCN_MEM_READ
54// CHECK-NEXT: ]
55// CHECK-NEXT: SectionData (
56// CHECK-NEXT:   0000: 01050200 05500402
57// CHECK-NEXT: )
58
59
60
61    .section .text$foo,"x"
62    .globl foo
63    .def foo; .scl 2; .type 32; .endef
64    .seh_proc foo
65foo:
66    subq $8, %rsp
67    .seh_stackalloc 8
68    pushq %rbp
69    .seh_pushreg %rbp
70    .seh_endprologue
71    popq %rbp
72    addq $8, %rsp
73    ret
74    .seh_endproc
75
76    .section .mytext,"x"
77    .globl bar
78    .def bar; .scl 2; .type 32; .endef
79    .seh_proc bar
80bar:
81    subq $8, %rsp
82    .seh_stackalloc 8
83    pushq %rbp
84    .seh_pushreg %rbp
85    .seh_endprologue
86    popq %rbp
87    addq $8, %rsp
88    ret
89    .seh_endproc
90
91    .section .text
92    .globl baz
93    .def baz; .scl 2; .type 32; .endef
94    .seh_proc baz
95baz:
96    subq $8, %rsp
97    .seh_stackalloc 8
98    pushq %rbp
99    .seh_pushreg %rbp
100    .seh_endprologue
101    popq %rbp
102    addq $8, %rsp
103    ret
104    .seh_endproc
105
106