2 # RUN: split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/asm -o %t.o
5 # RUN: ld.lld -T %t/lts %t.o -o %t_le
6 # RUN: llvm-objdump --mcpu=pwr10 --no-show-raw-insn -d %t_le | FileCheck %s
7 # RUN: llvm-readelf -s %t_le | FileCheck %s --check-prefix=SYM
9 # RUN: llvm-mc -filetype=obj -triple=powerpc64 %t/asm -o %t.o
10 # RUN: ld.lld -T %t/lts %t.o -o %t_be
11 # RUN: llvm-objdump --mcpu=pwr10 --no-show-raw-insn -d %t_be | FileCheck %s
12 # RUN: llvm-readelf -s %t_be | FileCheck %s --check-prefix=SYM
14 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/asm -o %t.o
15 # RUN: ld.lld -T %t/lts %t.o -o %t_le --no-power10-stubs
16 # RUN: llvm-objdump --mcpu=pwr10 --no-show-raw-insn -d %t_le | FileCheck %s --check-prefix=NoP10
17 # RUN: llvm-readelf -s %t_le | FileCheck %s --check-prefix=SYM
19 # SYM: Symbol table '.symtab' contains 9 entries:
20 # SYM: 1: 0000000010010000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 1 callee
21 # SYM-NEXT: 2: 0000000010020008 0 NOTYPE LOCAL DEFAULT 2 caller_close
22 # SYM-NEXT: 3: 0000000020020008 0 NOTYPE LOCAL DEFAULT [<other: 0x60>] 3 caller
23 # SYM-NEXT: 4: 0000000520020008 0 NOTYPE LOCAL DEFAULT 4 caller_far
24 # SYM-NEXT: 5: 0000000520028040 0 NOTYPE LOCAL HIDDEN 6 .TOC.
25 # SYM-NEXT: 6: 0000000010020020 8 FUNC LOCAL DEFAULT 2 __toc_save_callee
26 # SYM-NEXT: 7: 0000000020020020 32 FUNC LOCAL DEFAULT 3 __toc_save_callee
27 # SYM-NEXT: 8: 0000000520020020 32 FUNC LOCAL DEFAULT 4 __toc_save_callee
31 callee PT_LOAD FLAGS
(0x1 |
0x4);
32 close PT_LOAD FLAGS
(0x1 |
0x4);
33 caller PT_LOAD FLAGS
(0x1 |
0x4);
34 far PT_LOAD FLAGS
(0x1 |
0x4);
37 .text_callee 0x10010000 : { *(.text_callee) } :callee
38 .text_caller_close 0x10020000 : { *(.text_caller_close) } :close
39 .text_caller 0x20020000 : { *(.text_caller) } :caller
40 .text_caller_far 0x520020000 : { *(.text_caller_far) } :far
44 # CHECK-LABEL: <callee>:
46 .section .text_callee, "ax", %progbits
51 # CHECK-LABEL: <caller_close>:
52 # CHECK: bl 0x10020020
53 # CHECK-NEXT: ld 2, 24(1)
55 # CHECK-LABEL: <__toc_save_callee>:
57 # CHECK-NEXT: b 0x10010000
58 .section .text_caller_close, "ax", %progbits
60 .quad .TOC.-.Lfunc_gep1
63 ld 2, .Lfunc_toc1-.Lfunc_gep1(12)
66 .localentry caller, .Lfunc_lep1-.Lfunc_gep1
71 # CHECK-LABEL: <caller>:
72 # CHECK: bl 0x20020020
73 # CHECK-NEXT: ld 2, 24(1)
75 # CHECK-LABEL: <__toc_save_callee>:
77 # CHECK-NEXT: paddi 12, 0, -268501028, 1
78 # CHECK-NEXT: mtctr 12
81 # NoP10-LABEL: <caller>:
82 # NoP10: bl 0x20020020
83 # NoP10-NEXT: ld 2, 24(1)
85 # NoP10-LABEL: <__toc_save_callee>:
86 # NoP10-NEXT: std 2, 24(1)
87 # NoP10-NEXT: addis 12, 2, -4098
88 # NoP10-NEXT: addi 12, 12, 32704
89 # NoP10-NEXT: mtctr 12
91 .section .text_caller, "ax", %progbits
93 .quad .TOC.-.Lfunc_gep2
96 ld 2, .Lfunc_toc2-.Lfunc_gep2(12)
99 .localentry caller, .Lfunc_lep2-.Lfunc_gep2
104 # CHECK-LABEL: <caller_far>:
105 # CHECK: ld 2, -8(12)
106 # CHECK-NEXT: add 2, 2, 12
107 # CHECK-NEXT: bl 0x520020020
108 # CHECK-NEXT: ld 2, 24(1)
110 # CHECK-LABEL: <__toc_save_callee>:
111 # CHECK: std 2, 24(1)
112 # CHECK-NEXT: addis 12, 2, 0
113 # CHECK-NEXT: ld 12, -32760(12)
114 # CHECK-NEXT: mtctr 12
116 .section .text_caller_far, "ax", %progbits
118 .quad .TOC.-.Lfunc_gep3
121 ld 2, .Lfunc_toc3-.Lfunc_gep3(12)
124 .localentry caller, .Lfunc_lep3-.Lfunc_gep3