ppc64-pcrel-long-branch.s
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# REQUIRES: ppc
# RUN: echo 'SECTIONS { \
# RUN: .text_low 0x2000: { *(.text_low) } \
# RUN: .text_high 0x2002000 : { *(.text_high) } \
# RUN: }' > %t.script
# RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
# RUN: ld.lld -T %t.script %t.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %s -o %t.o
# RUN: ld.lld -shared -T %t.script %t.o -o %t.so
# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t.so | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o
# RUN: ld.lld -T %t.script %t.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %s -o %t.o
# RUN: ld.lld -shared -T %t.script %t.o -o %t.so
# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t.so | FileCheck %s
# CHECK-LABEL: <_start>:
# CHECK-NEXT: 2000: bl 0x2010
# CHECK-NEXT: blr
# CHECK-NEXT: trap
# CHECK-NEXT: trap
## Callee address - program counter = 0x2002000 - 0x2010 = 33554416
# CHECK-LABEL: <__long_branch_pcrel_high>:
# CHECK-NEXT: 2010: paddi 12, 0, 33554416, 1
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
# CHECK-LABEL: <high>:
# CHECK-NEXT: 2002000: blr
.section .text_low, "ax", %progbits
.globl _start
_start:
bl high@notoc
blr
.section .text_high, "ax", %progbits
.ifdef HIDDEN
.hidden high
.endif
.globl high
high:
blr