diff options
| author | Diana Picus <diana.picus@linaro.org> | 2017-02-21 11:33:59 +0000 |
|---|---|---|
| committer | Diana Picus <diana.picus@linaro.org> | 2017-02-21 11:33:59 +0000 |
| commit | 613b65696a04a29047fe1628c1f6e3587cc024ee (patch) | |
| tree | 13166fb72a9c9d30fe7d3743ab6b2e36fc09551d /llvm/test/CodeGen/ARM | |
| parent | ba5df6dea5194099a740ed09c48c3080a14210b6 (diff) | |
| download | bcm5719-llvm-613b65696a04a29047fe1628c1f6e3587cc024ee.tar.gz bcm5719-llvm-613b65696a04a29047fe1628c1f6e3587cc024ee.zip | |
[ARM] GlobalISel: Lower calls to void() functions
For now, we hardcode a BLX instruction, and generate an ADJCALLSTACKDOWN/UP pair
with amount 0.
llvm-svn: 295716
Diffstat (limited to 'llvm/test/CodeGen/ARM')
| -rw-r--r-- | llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll b/llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll index ead9950ecac..28bbda4dc8e 100644 --- a/llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll +++ b/llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll @@ -335,3 +335,26 @@ entry: %v = fadd double %p0, %p1 ret double %v } + +define arm_aapcscc void @test_indirect_call(void() *%fptr) { +; CHECK-LABEL: name: test_indirect_call +; CHECK: [[FPTR:%[0-9]+]](p0) = COPY %r0 +; CHECK: ADJCALLSTACKDOWN 0, 14, _, implicit-def %sp, implicit %sp +; CHECK: BLX [[FPTR]](p0), csr_aapcs, implicit-def %lr, implicit %sp +; CHECK: ADJCALLSTACKUP 0, 0, 14, _, implicit-def %sp, implicit %sp +entry: + notail call arm_aapcscc void %fptr() + ret void +} + +declare arm_aapcscc void @call_target() + +define arm_aapcscc void @test_direct_call() { +; CHECK-LABEL: name: test_direct_call +; CHECK: ADJCALLSTACKDOWN 0, 14, _, implicit-def %sp, implicit %sp +; CHECK: BLX @call_target, csr_aapcs, implicit-def %lr, implicit %sp +; CHECK: ADJCALLSTACKUP 0, 0, 14, _, implicit-def %sp, implicit %sp +entry: + notail call arm_aapcscc void @call_target() + ret void +} |

