1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/MC/ELF/strtab-suffix-opt.s
Fangrui Song d33006d182 ELFObjectWriter: Don't sort non-local symbols
As we don't sort local symbols, don't sort non-local symbols.  This makes
non-local symbols appear in their register order, which matches GNU as. The
register order is nice in that you can write tests with interleaved CHECK
prefixes, e.g.

```
// CHECK: something about foo
.globl foo
foo:
// CHECK: something about bar
.globl bar
bar:
```

With the lexicographical order, the user needs to place lexicographical smallest
symbol first or keep CHECK prefixes in one place.
2021-02-13 10:32:27 -08:00

22 lines
404 B
ArmAsm

// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | llvm-readobj --symbols - | FileCheck %s
.text
.globl foobar
.align 16, 0x90
.type foobar,@function
foobar:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
calll foo
calll bar
addl $8, %esp
popl %ebp
retl
.Ltmp3:
.size foobar, .Ltmp3-foobar
// CHECK: Name: foobar (11)
// CHECK: Name: foo (18)
// CHECK: Name: bar (14)