[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / ppc64-long-branch-init.s
blobe0be082e4b5493ebcb4a5716171ba9dca6e7e98f
1 # REQUIRES: ppc
3 # RUN: llvm-mc -filetype=obj -triple=powerpc64-pc-freebsd13.0 %s -o %t.o
4 # RUN: ld.lld %t.o -o %t
5 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
7 ## .init consists of sections from several object files. Sections other than the
8 ## last one do not have a terminator. Check we do not create a long branch stub
9 ## in the middle.
10 ## We currently use thunk section spacing to ensure the stub is in the end. This
11 ## is not foolproof but good enough to not break in practice.
13 # CHECK: Disassembly of section .init:
14 # CHECK-EMPTY:
15 # CHECK-LABEL: <_init>:
16 # CHECK: blr
17 # CHECK-NEXT: trap
18 # CHECK-NEXT: trap
19 # CHECK-EMPTY:
20 # CHECK-LABEL: <__long_branch_foo>:
22 .globl foo
23 foo:
24 .space 0x2000000
25 blr
27 .section .init,"ax",@progbits,unique,0
28 .globl _init
29 _init:
30 stdu 1, -48(1)
31 mflr 0
32 std 0, 64(1)
34 .section .init,"ax",@progbits,unique,1
35 bl foo
36 nop
38 .section .init,"ax",@progbits,unique,2
39 bl foo
40 nop
42 .section .init,"ax",@progbits,unique,3
43 ld 1, 0(1)
44 ld 0, 16(1)
45 mtlr 0
46 blr