[llvm] r209820 - Add a test showing the ppc code sequence for getting a function pointer.

Rafael Espindola rafael.espindola at gmail.com
Thu May 29 08:13:24 PDT 2014


Author: rafael
Date: Thu May 29 10:13:23 2014
New Revision: 209820

URL: http://llvm.org/viewvc/llvm-project?rev=209820&view=rev
Log:
Add a test showing the ppc code sequence for getting a function pointer.

This would have found the miscompile in r209638.

Added:
    llvm/trunk/test/CodeGen/PowerPC/func-addr.ll

Added: llvm/trunk/test/CodeGen/PowerPC/func-addr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/func-addr.ll?rev=209820&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/func-addr.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/func-addr.ll Thu May 29 10:13:23 2014
@@ -0,0 +1,21 @@
+; RUN: llc -mtriple powerpc64-linux < %s | FileCheck %s
+
+define void @foo()  {
+  ret void
+}
+declare i32 @bar(i8*)
+
+; CHECK-LABEL: {{^}}zed:
+; CHECK:        addis 3, 2, .LC1 at toc@ha
+; CHECK-NEXT:   ld 3, .LC1 at toc@l(3)
+; CHECK-NEXT:   bl bar
+
+
+; CHECK-LABEL: .section        .toc,"aw", at progbits
+; CHECK:       .LC1:
+; CHECK-NEXT:  .tc foo[TC],foo
+
+define  void @zed() {
+  call i32 @bar(i8* bitcast (void ()* @foo to i8*))
+  ret void
+}





More information about the llvm-commits mailing list