1# REQUIRES: ppc 2# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o 3# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s 4 5# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o 6# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s 7 8## This test checks that the linker produces errors when it is missing the nop 9## after a local call to a callee with st_other=1. 10 11# CHECK: (.text+0xC): call to save_callee lacks nop, can't restore toc 12# CHECK: (.text+0x1C): call to save_callee lacks nop, can't restore toc 13 14callee: 15 .localentry callee, 1 16 blr # 0x0 17 18caller: 19.Lfunc_gep1: 20 addis 2, 12, .TOC.-.Lfunc_gep1@ha 21 addi 2, 2, .TOC.-.Lfunc_gep1@l 22.Lfunc_lep1: 23 .localentry caller, .Lfunc_lep1-.Lfunc_gep1 24 bl callee # 0xC 25 blr 26 27caller_tail: 28.Lfunc_gep2: 29 addis 2, 12, .TOC.-.Lfunc_gep2@ha 30 addi 2, 2, .TOC.-.Lfunc_gep2@l 31.Lfunc_lep2: 32 .localentry caller_tail, .Lfunc_lep2-.Lfunc_gep2 33 b callee # 0x1C 34