llvm-capstone/lld/test/ELF/mips-call16.s
Fangrui Song 71e2ca6e32 [llvm-objdump] -d: print 00000000 <foo>: instead of 00000000 foo:
The new behavior matches GNU objdump. A pair of angle brackets makes tests slightly easier.

`.foo:` is not unique and thus cannot be used in a `CHECK-LABEL:` directive.
Without `-LABEL`, the CHECK line can match the `Disassembly of section`
line and causes the next `CHECK-NEXT:` to fail.

```
Disassembly of section .foo:

0000000000001634 .foo:
```

Bdragon: <> has metalinguistic connotation. it just "feels right"

Reviewed By: rupprecht

Differential Revision: https://reviews.llvm.org/D75713
2020-03-05 18:05:28 -08:00

30 lines
713 B
ArmAsm

# REQUIRES: mips
# Check R_MIPS_CALL16 relocation calculation.
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
# RUN: llvm-readelf -A --symbols %t.so | FileCheck -check-prefix=GOT %s
.text
.globl __start
__start:
lw $t0,%call16(g1)($gp)
.globl g1
.type g1,@function
g1:
nop
# CHECK: Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: <__start>:
# CHECK-NEXT: {{.*}}: lw $8, -32744
# GOT: Symbol table '.symtab'
# GOT: {{.*}}: [[G1:[0-9a-f]+]] {{.*}} g1
# GOT: Primary GOT:
# GOT: Global entries:
# GOT: {{.*}} -32744(gp) [[G1]] [[G1]] FUNC 7 g1