Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / mips-got-weak.s
blob93d2cedb7a2fc78b572481fd8443506acd122ff2
1 # REQUIRES: mips
2 # Check R_MIPS_GOT16 relocation against weak symbols.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5 # RUN: ld.lld %t.o -shared -o %t1.so
6 # RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t1.so \
7 # RUN: | FileCheck -check-prefixes=CHECK,NOSYM %s
8 # RUN: ld.lld %t.o -shared -Bsymbolic -o %t2.so
9 # RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t2.so \
10 # RUN: | FileCheck -check-prefixes=CHECK,SYM %s
12 # CHECK: Dynamic section
13 # CHECK: (MIPS_SYMTABNO) 4
14 # NOSYM: (MIPS_LOCAL_GOTNO) 2
15 # NOSYM: (MIPS_GOTSYM) 0x1
16 # SYM: (MIPS_LOCAL_GOTNO) 4
17 # SYM: (MIPS_GOTSYM) 0x3
19 # CHECK: There are no relocations in this file.
21 # CHECK: Symbol table '.dynsym'
22 # CHECK-DAG: [[FOO:[0-9a-f]+]] 0 NOTYPE WEAK DEFAULT 8 foo
23 # CHECK-DAG: 00000000 0 NOTYPE WEAK DEFAULT UND bar
24 # CHECK-DAG: [[SYM:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 8 sym
26 # NOSYM: Primary GOT:
27 # NOSYM-NOT: Local entries:
28 # NOSYM: Global entries:
29 # NOSYM-NEXT: Access Initial Sym.Val. Type Ndx Name
30 # NOSYM-NEXT: -32744(gp) [[FOO]] [[FOO]] NOTYPE 8 foo
31 # NOSYM-NEXT: -32740(gp) 00000000 00000000 NOTYPE UND bar
32 # NOSYM-NEXT: -32736(gp) [[SYM]] [[SYM]] NOTYPE 8 sym
34 # SYM: Primary GOT:
35 # SYM: Local entries:
36 # SYM-NEXT: Access Initial
37 # SYM-NEXT: -32744(gp) [[FOO]]
38 # SYM-NEXT: -32740(gp) [[SYM]]
39 # SYM: Global entries:
40 # SYM-NEXT: Access Initial Sym.Val. Type Ndx Name
41 # SYM-NEXT: -32736(gp) 00000000 00000000 NOTYPE UND bar
43 .text
44 .global sym
45 .weak foo,bar
46 func:
47 lw $t0,%got(foo)($gp)
48 lw $t0,%got(bar)($gp)
49 lw $t0,%got(sym)($gp)
51 .data
52 .weak foo
53 foo:
54 .word 0
55 sym:
56 .word 0