1# REQUIRES: ppc 2 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 6 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. 12 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>: 21 22.globl foo 23foo: 24 .space 0x2000000 25 blr 26 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) 33 34.section .init,"ax",@progbits,unique,1 35 bl foo 36 nop 37 38.section .init,"ax",@progbits,unique,2 39 bl foo 40 nop 41 42.section .init,"ax",@progbits,unique,3 43 ld 1, 0(1) 44 ld 0, 16(1) 45 mtlr 0 46 blr 47