[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / ppc64-pcrel-long-branch.s
blobd7ca9f59f38e8789660d0f2497cb507bb14f20a1
1 # REQUIRES: ppc
2 # RUN: echo 'SECTIONS { \
3 # RUN: .text_low 0x2000: { *(.text_low) } \
4 # RUN: .text_high 0x2002000 : { *(.text_high) } \
5 # RUN: }' > %t.script
7 # RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
8 # RUN: ld.lld -T %t.script %t.o -o %t
9 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
11 # RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %s -o %t.o
12 # RUN: ld.lld -shared -T %t.script %t.o -o %t.so
13 # RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
15 # RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o
16 # RUN: ld.lld -T %t.script %t.o -o %t
17 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
19 # RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %s -o %t.o
20 # RUN: ld.lld -shared -T %t.script %t.o -o %t.so
21 # RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
22 # RUN: llvm-readelf --dynamic %t.so | FileCheck --check-prefix=READELF %s
24 # CHECK-LABEL: <_start>:
25 # CHECK-NEXT: 2000: bl 0x2010
26 # CHECK-NEXT: blr
27 # CHECK-NEXT: trap
28 # CHECK-NEXT: trap
30 ## Callee address - program counter = 0x2002000 - 0x2010 = 33554416
31 # CHECK-LABEL: <__gep_setup_high>:
32 # CHECK-NEXT: 2010: paddi 12, 0, 33554416, 1
33 # CHECK-NEXT: mtctr 12
34 # CHECK-NEXT: bctr
36 # CHECK-LABEL: <high>:
37 # CHECK-NEXT: 2002000: blr
39 # READELF: (PPC64_OPT) 0x2
41 .section .text_low, "ax", %progbits
42 .globl _start
43 _start:
44 bl high@notoc
45 blr
47 .section .text_high, "ax", %progbits
48 .ifdef HIDDEN
49 .hidden high
50 .endif
51 .globl high
52 high:
53 blr