[llvm] r329355 - [RuntimeDyld][PowerPC] Add a test case for r329335.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 14:56:55 PDT 2018


Author: lhames
Date: Thu Apr  5 14:56:55 2018
New Revision: 329355

URL: http://llvm.org/viewvc/llvm-project?rev=329355&view=rev
Log:
[RuntimeDyld][PowerPC] Add a test case for r329335.

Checks that calls to different sections go to the function's global entry point,
rather than the local one.

Added:
    llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/
    llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/ppc64_elf_module_b.s
    llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s

Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/ppc64_elf_module_b.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/ppc64_elf_module_b.s?rev=329355&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/ppc64_elf_module_b.s (added)
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/Inputs/ppc64_elf_module_b.s Thu Apr  5 14:56:55 2018
@@ -0,0 +1,42 @@
+# This module contains a function with its local and global entry points
+# exposed. It is used by the ppc64_elf test to verify that functions with
+# different TOCs are called via their global entry points.
+	.text
+	.abiversion 2
+	.file	"ppc64_elf_module_b.ll"
+	.section	.rodata.cst4,"aM", at progbits,4
+	.p2align	2               # -- Begin function foo
+.LCPI0_0:
+	.long	1093664768              # float 11
+	.text
+	.globl	foo
+	.p2align	4
+	.type	foo, at function
+.Lfunc_toc0:                            # @foo
+	.quad	.TOC.-foo_gep
+foo:
+.Lfunc_begin0:
+	.cfi_startproc
+        .globl  foo_gep
+foo_gep:
+	ld 2, .Lfunc_toc0-foo_gep(12)
+	add 2, 2, 12
+        .globl  foo_lep
+foo_lep:
+	.localentry	foo, foo_lep-foo_gep
+# %bb.0:
+	addis 3, 2, .LC0 at toc@ha
+	ld 3, .LC0 at toc@l(3)
+	lfsx 1, 0, 3
+	blr
+	.long	0
+	.quad	0
+.Lfunc_end0:
+	.size	foo, .Lfunc_end0-.Lfunc_begin0
+	.cfi_endproc
+                                        # -- End function
+	.section	.toc,"aw", at progbits
+.LC0:
+	.tc .LCPI0_0[TC],.LCPI0_0
+
+	.section	".note.GNU-stack","", at progbits

Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s?rev=329355&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s (added)
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s Thu Apr  5 14:56:55 2018
@@ -0,0 +1,47 @@
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t/ppc64_elf.o %s
+# RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t/ppc64_elf_module_b.o %S/Inputs/ppc64_elf_module_b.s
+# RUN: llvm-rtdyld -triple=powerpc64le-unknown-linux-gnu -verify -check=%s %t/ppc64_elf.o %t/ppc64_elf_module_b.o
+
+       	.text
+	.abiversion 2
+	.file	"Module2.ll"
+	.globl	bar                     # -- Begin function bar
+	.p2align	4
+	.type	bar, at function
+.Lfunc_toc0:                            # @bar
+	.quad	.TOC.-.Lfunc_gep0
+bar:
+.Lfunc_begin0:
+	.cfi_startproc
+.Lfunc_gep0:
+	ld 2, .Lfunc_toc0-.Lfunc_gep0(12)
+	add 2, 2, 12
+.Lfunc_lep0:
+	.localentry	bar, .Lfunc_lep0-.Lfunc_gep0
+# %bb.0:
+	mflr 0
+	std 0, 16(1)
+	stdu 1, -32(1)
+	.cfi_def_cfa_offset 32
+	.cfi_offset lr, 16
+# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) +  0)) [15:0] = foo_gep [63:48]
+# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) +  4)) [15:0] = foo_gep [47:32]
+# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 12)) [15:0] = foo_gep [31:16]
+# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 16)) [15:0] = foo_gep [16:0]
+# rtdyld-check: decode_operand(foo_call, 0) = (stub_addr(ppc64_elf.o, .text, foo) - foo_call) >> 2
+foo_call:
+	bl foo
+	nop
+	addi 1, 1, 32
+	ld 0, 16(1)
+	mtlr 0
+	blr
+	.long	0
+	.quad	0
+.Lfunc_end0:
+	.size	bar, .Lfunc_end0-.Lfunc_begin0
+	.cfi_endproc
+                                        # -- End function
+
+	.section	".note.GNU-stack","", at progbits




More information about the llvm-commits mailing list