Skip to content

Commit

Permalink
ARM: Fix an old refacto.
Browse files Browse the repository at this point in the history
Fixes PR15520.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177167 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Mar 15, 2013
1 parent 2d37f7b commit 133c0d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Target/ARM/ARMAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {

OutStreamer.EmitInstruction(MCInstBuilder(ARM::MOVr)
.addReg(ARM::PC)
.addImm(MI->getOperand(0).getReg())
.addReg(MI->getOperand(0).getReg())
// Add predicate operands.
.addImm(ARMCC::AL)
.addReg(0)
Expand Down
14 changes: 12 additions & 2 deletions test/CodeGen/ARM/call_nolink.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
; RUN: not grep "bx lr"
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | FileCheck %s

%struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
@r = external global [14 x i32] ; <[14 x i32]*> [#uses=4]
Expand All @@ -8,6 +7,8 @@
@numi = external global i32 ; <i32*> [#uses=1]
@counter = external global [2 x i32] ; <[2 x i32]*> [#uses=1]

; CHECK: main_bb_2E_i_bb205_2E_i_2E_i_bb115_2E_i_2E_i:
; CHECK-NOT: bx lr

define void @main_bb_2E_i_bb205_2E_i_2E_i_bb115_2E_i_2E_i() {
newFuncRoot:
Expand Down Expand Up @@ -50,3 +51,12 @@ bb115.i.i: ; preds = %bb115.i.i.bb115.i.i_crit_edge, %newFuncRoot
icmp slt i32 %tmp166.i.i, %tmp168.i.i ; <i1>:0 [#uses=1]
br i1 %0, label %bb115.i.i.bb115.i.i_crit_edge, label %bb115.i.i.bb170.i.i_crit_edge.exitStub
}

define void @PR15520(void ()* %fn) {
call void %fn()
ret void

; CHECK: PR15520:
; CHECK: mov lr, pc
; CHECK: mov pc, r0
}

0 comments on commit 133c0d3

Please sign in to comment.