[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / mips-64-disp.s
blob2c56e34ae77435e77620b49d35d4bf05c25a5916
1 # REQUIRES: mips
2 # Check R_MIPS_GOT_DISP relocations against various kind of symbols.
4 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
5 # RUN: %p/Inputs/mips-pic.s -o %t.so.o
6 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.exe.o
7 # RUN: ld.lld %t.so.o -shared -soname=t.so -o %t.so
8 # RUN: ld.lld %t.exe.o %t.so -o %t.exe
9 # RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.exe | FileCheck %s
10 # RUN: llvm-readelf -r -s -A %t.exe | FileCheck -check-prefix=GOT %s
12 # CHECK: <__start>:
13 # CHECK-NEXT: {{.*}}: addiu $2, $2, -32704
14 # CHECK-EMPTY:
15 # CHECK-NEXT: <b4>:
16 # CHECK-NEXT: {{.*}}: addiu $2, $2, -32736
17 # CHECK-EMPTY:
18 # CHECK-NEXT: <b8>:
19 # CHECK-NEXT: {{.*}}: addiu $2, $2, -32728
20 # CHECK-EMPTY:
21 # CHECK-NEXT: <b12>:
22 # CHECK-NEXT: {{.*}}: addiu $2, $2, -32720
23 # CHECK-NEXT: {{.*}}: addiu $2, $2, -32712
25 # GOT: Symbol table '.symtab'
26 # GOT: {{.*}} [[B04:[0-9a-f]+]] {{.*}} b4
27 # GOT: {{.*}} [[FOO:[0-9a-f]+]] {{.*}} foo
28 # GOT: {{.*}} [[B08:[0-9a-f]+]] {{.*}} b8
29 # GOT: {{.*}} [[B12:[0-9a-f]+]] {{.*}} b12
31 # GOT: Primary GOT:
32 # GOT-NEXT: Canonical gp value:
33 # GOT-EMPTY:
34 # GOT-NEXT: Reserved entries:
35 # GOT-NEXT: Address Access Initial Purpose
36 # GOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
37 # GOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
38 # GOT-EMPTY:
39 # GOT-NEXT: Local entries:
40 # GOT-NEXT: Address Access Initial
41 # GOT-NEXT: {{.*}} -32736(gp) [[FOO]]
42 # GOT-NEXT: {{.*}} -32728(gp) [[B04]]
43 # GOT-NEXT: {{.*}} -32720(gp) [[B08]]
44 # GOT-NEXT: {{.*}} -32712(gp) [[B12]]
45 # GOT-EMPTY:
46 # GOT-NEXT: Global entries:
47 # GOT-NEXT: Address Access Initial Sym.Val. Type Ndx Name
48 # GOT-NEXT: {{.*}} -32704(gp) 0000000000000000 0000000000000000 FUNC UND foo1a
50 .text
51 .global __start
52 __start:
53 addiu $v0,$v0,%got_disp(foo1a) # R_MIPS_GOT_DISP
54 b4:
55 addiu $v0,$v0,%got_disp(foo) # R_MIPS_GOT_DISP
56 b8:
57 addiu $v0,$v0,%got_disp(.text+4) # R_MIPS_GOT_DISP
58 b12:
59 addiu $v0,$v0,%got_disp(.text+8) # R_MIPS_GOT_DISP
60 addiu $v0,$v0,%got_disp(.text+12) # R_MIPS_GOT_DISP
62 foo:
63 nop