Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / eh-frame-value-format7.s
blob99eff108026a210a88ab925bfead316e11365e78
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4 # RUN: ld.lld --eh-frame-hdr --section-start .text=0x1000 %t.o -o %t
5 # RUN: llvm-readobj -S --section-data %t | FileCheck %s
7 ## Check we are able to handle DW_EH_PE_udata2 encoding.
9 # CHECK: Section {
10 # CHECK: Index:
11 # CHECK: Name: .eh_frame_hdr
12 # CHECK-NEXT: Type: SHT_PROGBITS
13 # CHECK-NEXT: Flags [
14 # CHECK-NEXT: SHF_ALLOC
15 # CHECK-NEXT: ]
16 # CHECK-NEXT: Address: 0x2004
17 # CHECK-NEXT: Offset: 0x1004
18 # CHECK-NEXT: Size: 20
19 # CHECK-NEXT: Link: 0
20 # CHECK-NEXT: Info: 0
21 # CHECK-NEXT: AddressAlignment: 4
22 # CHECK-NEXT: EntrySize: 0
23 # CHECK-NEXT: SectionData (
24 # CHECK-NEXT: 0000: 011B033B 10000000 01000000 30F2FFFF
25 # CHECK-NEXT: 0010: 26000000
26 # Header (always 4 bytes): 011B033B
27 # 10000000 = .eh_frame(0x2018) - .eh_frame_hdr(0x2004) - 4
28 # 01000000 = 1 = the number of FDE pointers in the table.
29 # 30F2FFFF = foo(0x1000) - 0x234(addend) - .eh_frame_hdr(0x2004)
31 # CHECK: Section {
32 # CHECK: Index:
33 # CHECK: Name: .eh_frame
34 # CHECK-NEXT: Type: SHT_PROGBITS
35 # CHECK-NEXT: Flags [
36 # CHECK-NEXT: SHF_ALLOC
37 # CHECK-NEXT: ]
38 # CHECK-NEXT: Address: 0x2018
39 # CHECK-NEXT: Offset: 0x1018
40 # CHECK-NEXT: Size:
41 # CHECK-NEXT: Link:
42 # CHECK-NEXT: Info:
43 # CHECK-NEXT: AddressAlignment:
44 # CHECK-NEXT: EntrySize:
45 # CHECK-NEXT: SectionData (
46 # CHECK-NEXT: 0000: 0E000000 00000000 01525300 01010102
47 # CHECK-NEXT: 0010: FF000600 00001600 00003412 00000000
48 # ^
49 # ---> ADDR(foo) + 0x234 = 0x1234
51 .text
52 .global foo
53 foo:
54 nop
56 .section .eh_frame,"a",@unwind
57 .long 14 # Size
58 .long 0x00 # ID
59 .byte 0x01 # Version.
61 .byte 0x52 # Augmentation string: 'R','S','\0'
62 .byte 0x53
63 .byte 0x00
65 .byte 0x01
67 .byte 0x01 # LEB128
68 .byte 0x01 # LEB128
70 .byte 0x02 # DW_EH_PE_udata2
72 .byte 0xFF
73 .byte 0
75 .long 0x6 # Size
76 .long 0x16 # ID
77 .short foo + 0x234