summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2014-06-18 17:28:56 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2014-06-18 17:28:56 +0000
commit496e7ea119421a2779d8e144266b6ccba2354cd7 (patch)
tree77ec736211adf82b4556bb3e56ad28364ff0f2ac /test
parent5d5ddf9663fdfbc47ac0285c449f0abd92b3f5ad (diff)
downloadllvm-496e7ea119421a2779d8e144266b6ccba2354cd7.tar.gz
llvm-496e7ea119421a2779d8e144266b6ccba2354cd7.tar.bz2
llvm-496e7ea119421a2779d8e144266b6ccba2354cd7.tar.xz
[PowerPC] Add back test case for absolute calls (removed in r211174)
As requested by Hal Finkel, this adds back a test for calls to a known-constant function pointer value, and verifies that the 64-bit SVR4 indirect function call sequence is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/PowerPC/ppc64-calls.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/ppc64-calls.ll b/test/CodeGen/PowerPC/ppc64-calls.ll
index 396a5e25ca..54b6b6fe0b 100644
--- a/test/CodeGen/PowerPC/ppc64-calls.ll
+++ b/test/CodeGen/PowerPC/ppc64-calls.ll
@@ -42,6 +42,22 @@ define void @test_indirect(void ()* nocapture %fp) nounwind {
ret void
}
+; Absolute values must use the regular indirect call sequence
+; The main purpose of this test is to ensure that BLA is not
+; used on 64-bit SVR4 (as e.g. on Darwin).
+define void @test_abs() nounwind {
+; CHECK-LABEL: test_abs:
+ tail call void inttoptr (i64 1024 to void ()*)() nounwind
+; CHECK: ld [[FP:[0-9]+]], 1024(0)
+; CHECK: ld 11, 1040(0)
+; CHECK: mtctr [[FP]]
+; CHECK: li [[FD:[0-9]+]], 1024
+; CHECK: ld 2, 8([[FD]])
+; CHECK: bctrl
+; CHECK-NEXT: ld 2, 40(1)
+ ret void
+}
+
declare double @sin(double) nounwind
; External functions call should also have a 'nop'