1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/MC/ARM/elf-thumbfunc.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

41 lines
889 B
ArmAsm

@@ test st_value bit 0 of thumb function
@ RUN: llvm-mc %s -triple=thumbv7-linux-gnueabi -filetype=obj -o - | \
@ RUN: llvm-readobj --symbols - | FileCheck %s
.syntax unified
.text
.globl foo
.align 2
.code 16
.thumb_func
.type foo,%function
foo:
bx lr
.global bar
bar = foo
.global baz
baz = foo + 2
@@ make sure foo and bar are thumb function: bit 0 = 1 (st_value)
@CHECK: Symbol {
@CHECK: Name: foo
@CHECK-NEXT: Value: 0x1
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
@CHECK: Symbol {
@CHECK: Name: bar
@CHECK-NEXT: Value: 0x1
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
@CHECK: Symbol {
@CHECK: Name: baz
@CHECK-NEXT: Value: 0x3
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function