mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-11 13:37:07 +00:00
ARM: don't diagnose cbz/cbnz to Thumb functions.
A branch-distance to a Thumb function shouldn't be forced to be odd for CBZ/CBNZ instructions because (assuming it's within range), it's going to be a valid, even offset. llvm-svn: 279665
This commit is contained in:
parent
351c66ab91
commit
67e1ff026d
@ -710,7 +710,8 @@ void ARMAsmBackend::processFixupValue(const MCAssembler &Asm,
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_arm_adr_pcrel_12 &&
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_thumb_adr_pcrel_10 &&
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_t2_adr_pcrel_12 &&
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_arm_thumb_cp) {
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_arm_thumb_cp &&
|
||||
(unsigned)Fixup.getKind() != ARM::fixup_arm_thumb_cb) {
|
||||
if (Sym) {
|
||||
if (Asm.isThumbFunc(Sym))
|
||||
Value |= 1;
|
||||
|
@ -24,6 +24,13 @@ label1:
|
||||
label2:
|
||||
nop
|
||||
|
||||
@ CHECK: out of range pc-relative fixup value
|
||||
cbz r0, label4
|
||||
.space 33
|
||||
label4:
|
||||
nop
|
||||
|
||||
.align 2
|
||||
@ CHECK-NOT: label3
|
||||
cbnz r0, label3
|
||||
.space 128
|
8
test/MC/ARM/thumb-cb-thumbfunc.s
Normal file
8
test/MC/ARM/thumb-cb-thumbfunc.s
Normal file
@ -0,0 +1,8 @@
|
||||
@ RUN: llvm-mc -triple thumbv7-apple-macho -filetype=obj -o %t %s
|
||||
@ RUN: llvm-objdump -d -triple thumbv7 %t | FileCheck %s
|
||||
|
||||
@ CHECK: cbnz r0, #0
|
||||
.thumb_func label4
|
||||
cbnz r0, label4
|
||||
.space 2
|
||||
label4:
|
Loading…
Reference in New Issue
Block a user