Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / aarch64-gotpage.s
blobcb298a1791d9420ccfbdfb5051ccb95cdbbc1db7
1 # REQUIRES: aarch64
2 # RUN: split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %t/test.s -o %t.o
5 # RUN: ld.lld -shared --script %t/script %t.o -o %t.so
6 # RUN: ld.lld -pie --script %t/script %t.o -o %t.exe
7 # RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOCS-SHARED %s
8 # RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=RELOCS-PIE %s
9 # RUN: llvm-objdump --no-print-imm-hex --no-show-raw-insn -d %t.so | FileCheck --check-prefix=DISAS %s
11 ## Check if the R_AARCH64_LD64_GOTPAGE_LO15 generates the GOT entries.
12 # RELOCS-SHARED: Relocations [
13 # RELOCS-SHARED-NEXT: Section (5) .rela.dyn {
14 # RELOCS-SHARED-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_GLOB_DAT global1 0x{{[0-9A-F]+}}
15 # RELOCS-SHARED-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_GLOB_DAT global2 0x{{[0-9A-F]+}}
16 # RELOCS-SHARED-NEXT: }
17 # RELOCS-SHARED-NEXT: ]
19 # RELOCS-PIE: Relocations [
20 # RELOCS-PIE-NEXT: Section (5) .rela.dyn {
21 # RELOCS-PIE-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_RELATIVE - 0x{{[0-9A-F]+}}
22 # RELOCS-PIE-NEXT: 0x{{[0-9A-F]+}} R_AARCH64_RELATIVE - 0x{{[0-9A-F]+}}
23 # RELOCS-PIE-NEXT: }
24 # RELOCS-PIE-NEXT: ]
26 # DISAS: adrp x0, 0xf000
27 # DISAS-NEXT: ldr x0, [x0, #4088]
28 # DISAS-NEXT: ldr x1, [x0, #4096]
30 #--- script
31 SECTIONS {
32 .got (0x10000 - 8) : { *.got }
35 #--- test.s
36 .globl _start
37 .type _start,@function
38 _start:
39 adrp x0, _GLOBAL_OFFSET_TABLE_
40 ldr x0, [x0, #:gotpage_lo15:global1]
41 ldr x1, [x0, #:gotpage_lo15:global2]
43 .type global1,@object
44 .comm global1,8,8
45 .type global2,@object
46 .comm global2,8,8