Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / eh-frame-value-format8.s
blob6d5da05c2bfa7bcb54903ddf7b376310794847ca
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_absptr 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: 24000000
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: 0C000000 00000000 01520001 010100FF
47 # CHECK-NEXT: 0010: 0C000000 14000000 34120000 00000000
48 # ^
49 # ---> ADDR(foo) + 0x234 = 0x1234
50 .text
51 .global foo
52 foo:
53 nop
55 .section .eh_frame,"a",@unwind
56 .long 12 # Size
57 .long 0x00 # ID
58 .byte 0x01 # Version.
60 .byte 0x52 # Augmentation string: 'R','\0'
61 .byte 0x00
63 .byte 0x01
65 .byte 0x01 # LEB128
66 .byte 0x01 # LEB128
68 .byte 0x00 # DW_EH_PE_absptr
70 .byte 0xFF
72 .long 12 # Size
73 .long 0x14 # ID
74 .quad foo + 0x234