llvm.org GIT mirror llvm / 396d590
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329355 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 2 years ago
2 changed file(s) with 89 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 # This module contains a function with its local and global entry points
1 # exposed. It is used by the ppc64_elf test to verify that functions with
2 # different TOCs are called via their global entry points.
3 .text
4 .abiversion 2
5 .file "ppc64_elf_module_b.ll"
6 .section .rodata.cst4,"aM",@progbits,4
7 .p2align 2 # -- Begin function foo
8 .LCPI0_0:
9 .long 1093664768 # float 11
10 .text
11 .globl foo
12 .p2align 4
13 .type foo,@function
14 .Lfunc_toc0: # @foo
15 .quad .TOC.-foo_gep
16 foo:
17 .Lfunc_begin0:
18 .cfi_startproc
19 .globl foo_gep
20 foo_gep:
21 ld 2, .Lfunc_toc0-foo_gep(12)
22 add 2, 2, 12
23 .globl foo_lep
24 foo_lep:
25 .localentry foo, foo_lep-foo_gep
26 # %bb.0:
27 addis 3, 2, .LC0@toc@ha
28 ld 3, .LC0@toc@l(3)
29 lfsx 1, 0, 3
30 blr
31 .long 0
32 .quad 0
33 .Lfunc_end0:
34 .size foo, .Lfunc_end0-.Lfunc_begin0
35 .cfi_endproc
36 # -- End function
37 .section .toc,"aw",@progbits
38 .LC0:
39 .tc .LCPI0_0[TC],.LCPI0_0
40
41 .section ".note.GNU-stack","",@progbits
0 # RUN: rm -rf %t && mkdir -p %t
1 # RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t/ppc64_elf.o %s
2 # RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t/ppc64_elf_module_b.o %S/Inputs/ppc64_elf_module_b.s
3 # RUN: llvm-rtdyld -triple=powerpc64le-unknown-linux-gnu -verify -check=%s %t/ppc64_elf.o %t/ppc64_elf_module_b.o
4
5 .text
6 .abiversion 2
7 .file "Module2.ll"
8 .globl bar # -- Begin function bar
9 .p2align 4
10 .type bar,@function
11 .Lfunc_toc0: # @bar
12 .quad .TOC.-.Lfunc_gep0
13 bar:
14 .Lfunc_begin0:
15 .cfi_startproc
16 .Lfunc_gep0:
17 ld 2, .Lfunc_toc0-.Lfunc_gep0(12)
18 add 2, 2, 12
19 .Lfunc_lep0:
20 .localentry bar, .Lfunc_lep0-.Lfunc_gep0
21 # %bb.0:
22 mflr 0
23 std 0, 16(1)
24 stdu 1, -32(1)
25 .cfi_def_cfa_offset 32
26 .cfi_offset lr, 16
27 # rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 0)) [15:0] = foo_gep [63:48]
28 # rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 4)) [15:0] = foo_gep [47:32]
29 # rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 12)) [15:0] = foo_gep [31:16]
30 # rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 16)) [15:0] = foo_gep [16:0]
31 # rtdyld-check: decode_operand(foo_call, 0) = (stub_addr(ppc64_elf.o, .text, foo) - foo_call) >> 2
32 foo_call:
33 bl foo
34 nop
35 addi 1, 1, 32
36 ld 0, 16(1)
37 mtlr 0
38 blr
39 .long 0
40 .quad 0
41 .Lfunc_end0:
42 .size bar, .Lfunc_end0-.Lfunc_begin0
43 .cfi_endproc
44 # -- End function
45
46 .section ".note.GNU-stack","",@progbits