Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / ppc64-error-toc-local-call.s
blob8cb04c149496f279557a49395e4a1f49682b0215
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
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
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.
11 # CHECK: {{.*}}.o:(.text+0xc): call to save_callee lacks nop, can't restore toc
12 # CHECK-NEXT: {{.*}}.o:(.text+0x1c): call to save_callee lacks nop, can't restore toc
14 callee:
15 .localentry callee, 1
16 blr # 0x0
18 caller:
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
27 caller_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