aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/ARM/ARMInstrInfo.td1
-rw-r--r--test/CodeGen/ARM/call.ll12
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index 5392929462..349c358b89 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -149,6 +149,7 @@ let isReturn = 1 in {
let noResults = 1, Defs = [R0, R1, R2, R3, R14] in {
def bl: InstARM<(ops i32imm:$func, variable_ops), "bl $func", []>;
+ def blx : InstARM<(ops IntRegs:$func, variable_ops), "blx $func", [(ARMcall IntRegs:$func)]>;
}
def ldr : InstARM<(ops IntRegs:$dst, memri:$addr),
diff --git a/test/CodeGen/ARM/call.ll b/test/CodeGen/ARM/call.ll
index 316cb548bb..b223698c65 100644
--- a/test/CodeGen/ARM/call.ll
+++ b/test/CodeGen/ARM/call.ll
@@ -1,4 +1,7 @@
-; RUN: llvm-as < %s | llc -march=arm
+; RUN: llvm-as < %s | llc -march=arm &&
+; RUN: llvm-as < %s | llc -march=arm | grep bl &&
+; RUN: llvm-as < %s | llc -march=arm | grep blx
+
void %f() {
entry:
call void %g( int 1, int 2, int 3, int 4 )
@@ -8,3 +11,10 @@ entry:
declare void %g(int, int, int, int)
declare fastcc void %h()
+
+void %g(void (...)* %g) {
+entry:
+ %g_c = cast void (...)* %g to void ()*
+ call void %g_c( )
+ ret void
+}