Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / synthetic-got.s
blob89dc331e38bf45fd4e97d30183275286c87b20e7
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: echo "SECTIONS { }" > %t0.script
4 # RUN: ld.lld --hash-style=sysv -shared %t.o -o %t0.out --script %t0.script
5 # RUN: llvm-objdump --section-headers %t0.out | FileCheck %s --check-prefix=GOT
6 # RUN: llvm-objdump -s --section=.got --section=.got.plt %t0.out \
7 # RUN: | FileCheck %s --check-prefix=GOTDATA
9 # GOT: Sections:
10 # GOT: .got 00000008 00000000000001b0 DATA
11 # GOT: .got.plt 00000020 00000000000001b8 DATA
12 # GOTDATA: Contents of section .got:
13 # GOTDATA-NEXT: 01b0 00000000 00000000
14 # GOTDATA-NEXT: Contents of section .got.plt:
15 # GOTDATA-NEXT: 01b8 e0000000 00000000 00000000 00000000
16 # GOTDATA-NEXT: 01c8 00000000 00000000 d6000000 00000000
18 # RUN: echo "SECTIONS { .mygot : { *(.got) *(.got.plt) } }" > %t1.script
19 # RUN: ld.lld --hash-style=sysv -shared %t.o -o %t1.out --script %t1.script
20 # RUN: llvm-objdump --section-headers %t1.out | FileCheck %s --check-prefix=MYGOT
21 # RUN: llvm-objdump -s --section=.mygot %t1.out | FileCheck %s --check-prefix=MYGOTDATA
23 # MYGOT: Sections:
24 # MYGOT: 8 .mygot 00000028 00000000000000e0 DATA
25 # MYGOT-NOT: .got
26 # MYGOT-NOT: .got.plt
27 # MYGOTDATA: 00e0 00000000 00000000 08010000 00000000
28 # MYGOTDATA-NEXT: 00f0 00000000 00000000 00000000 00000000
29 # MYGOTDATA-NEXT: 0100 d6000000 00000000
31 mov bar@gotpcrel(%rip), %rax
32 call foo@plt