ppc64-long-branch-rel14.s
1.71 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
51
52
53
54
55
56
57
58
59
60
61
62
63
# REQUIRES: ppc
# RUN: echo 'SECTIONS { \
# RUN: .text_low 0x2000: { *(.text_low) } \
# RUN: .text_high 0xa000 : { *(.text_high) } \
# RUN: }' > %t.lds
# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
# RUN: ld.lld -T %t.lds %t.o -o %t
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
# RUN: ld.lld -pie -T %t.lds %t.o -o %t
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# SEC: There are no relocations in this file.
# CHECK-LABEL: <_start>:
# CHECK-NEXT: 2000: bt 2, 0x2020
# CHECK-NEXT: bt+ 2, 0x2020
# CHECK-NEXT: bf 2, 0xa004
# CHECK-NEXT: bt 2, 0x2030
# CHECK-NEXT: blr
# CHECK-NEXT: trap
# CHECK-NEXT: trap
# CHECK-NEXT: trap
# CHECK-EMPTY:
# CHECK-NEXT: <__long_branch_high>:
# CHECK-NEXT: 2020: addis 12, 2, 0
# CHECK-NEXT: ld 12, {{.*}}(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
# CHECK-EMPTY:
# CHECK-NEXT: <__long_branch_>:
# CHECK-NEXT: 2030: addis 12, 2, 0
# CHECK-NEXT: ld 12, {{.*}}(12)
# CHECK-NEXT: mtctr 12
# CHECK-NEXT: bctr
.section .text_low, "ax", @progbits
.globl _start
_start:
beq high # Need a thunk
beq+ high # Need a thunk
bne high
beq .text_high+16 # Need a thunk
blr
# CHECK-LABEL: <.text_high>:
# CHECK-NEXT: a000: nop
# CHECK-EMPTY:
# CHECK-LABEL: <high>:
# CHECK-NEXT: a004: bf 0, 0x2008
# CHECK-NEXT: bt 1, 0x2008
.section .text_high, "ax", @progbits
nop
.globl high
high:
bge .text_low+8 # Need a thunk
bgt .text_low+8 # Need a thunk