Skip to content

Commit b94a9bc

Browse files
committed
ARM: Improve branch fixup test
1 parent 7d65cb1 commit b94a9bc

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: llvm-mc -filetype=obj -triple=thumbv7a-linux-gnueabi %s -o %t
2+
// RUN: llvm-objdump -dr %t --triple=thumbv7a | FileCheck %s
3+
4+
// CHECK: f7ff fffe bl {{.*}} @ imm = #-0x4
5+
// CHECK-NEXT: 00000000: R_ARM_THM_CALL foo
6+
// CHECK-NEXT: f7ff effe blx {{.*}} @ imm = #-0x4
7+
// CHECK-NEXT: 00000004: R_ARM_THM_CALL callee_thumb_low
8+
// CHECK-NEXT: bf00 nop
9+
// CHECK-NEXT: f7ff effe blx {{.*}} @ imm = #-0x4
10+
// CHECK-NEXT: 0000000a: R_ARM_THM_CALL callee_thumb_high
11+
// CHECK-NEXT: 4770 bx lr
12+
13+
.syntax unified
14+
.section .text, "ax",%progbits
15+
.thumb
16+
bl foo
17+
18+
blx callee_thumb_low
19+
nop
20+
blx callee_thumb_high
21+
bx lr

llvm/test/MC/ARM/elf-thumbfunc-reloc.s

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,17 @@
1212
f:
1313
push {r7, lr}
1414
mov r7, sp
15-
bl g
1615
pop {r7, pc}
1716

1817
.section .data.rel.local,"aw",%progbits
1918
ptr:
2019
.long f
2120

2221

23-
@@ make sure an R_ARM_THM_CALL relocation is generated for the call to g
24-
@CHECK: Relocations [
25-
@CHECK-NEXT: Section {{.*}} .rel.text {
26-
@CHECK-NEXT: 0x4 R_ARM_THM_CALL g
27-
@CHECK-NEXT: }
28-
2922

3023
@@ make sure the relocation is with f. That is one way to make sure it includes
3124
@@ the thumb bit.
32-
@CHECK-NEXT: Section ({{.*}}) .rel.data.rel.local {
25+
@CHECK: Section ({{.*}}) .rel.data.rel.local {
3326
@CHECK-NEXT: 0x0 R_ARM_ABS32 f
3427
@CHECK-NEXT: }
3528
@CHECK-NEXT: ]

0 commit comments

Comments
 (0)