[llvm] r211190 - [PowerPC] Add back test case for absolute calls (removed in r211174)

Ulrich Weigand ulrich.weigand at de.ibm.com
Wed Jun 18 10:28:57 PDT 2014


Author: uweigand
Date: Wed Jun 18 12:28:56 2014
New Revision: 211190

URL: http://llvm.org/viewvc/llvm-project?rev=211190&view=rev
Log:
[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.


Modified:
    llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll

Modified: llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll?rev=211190&r1=211189&r2=211190&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll Wed Jun 18 12:28:56 2014
@@ -42,6 +42,22 @@ define void @test_indirect(void ()* noca
   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'





More information about the llvm-commits mailing list