66 lines · plain
1// REQUIRES: ppc2 3// RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o4// RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o5// RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/ppc64-func.s -o %t3.o6// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so7// RUN: ld.lld %t.o %t2.so %t3.o -o %t8// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s9 10// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o11// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o12// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/ppc64-func.s -o %t3.o13// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so14// RUN: ld.lld %t.o %t2.so %t3.o -o %t15// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s16 17 .text18 .abiversion 219.global bar_local20bar_local:21 li 3, 222 blr23 24# Calling external function foo in a shared object needs a nop.25# Calling local function bar_local doe not need a nop.26.global _start27_start:28 bl foo29 nop30 bl bar_local31// CHECK-LABEL: <_start>:32// CHECK-NEXT: 100102c8: bl 0x1001031033// CHECK-NEXT: 100102cc: ld 2, 24(1)34// CHECK-NEXT: 100102d0: bl 0x100102c035// CHECK-EMPTY:36 37# Calling a function in another object file which will have same38# TOC base does not need a nop. If nop present, do not rewrite to39# a toc restore40.global diff_object41_diff_object:42 bl foo_not_shared43 bl foo_not_shared44 nop45// CHECK-LABEL: <_diff_object>:46// CHECK-NEXT: 100102d4: bl 0x100102f047// CHECK-NEXT: 100102d8: bl 0x100102f048// CHECK-NEXT: 100102dc: nop49 50# Branching to a local function does not need a nop51.global noretbranch52noretbranch:53 b bar_local54// CHECK-LABEL: <noretbranch>:55// CHECK-NEXT: 100102e0: b 0x100102c056// CHECK-EMPTY:57 58// This should come last to check the end-of-buffer condition.59.global last60last:61 bl foo62 nop63// CHECK-LABEL: <last>:64// CHECK-NEXT: 100102e4: bl 0x1001031065// CHECK-NEXT: 100102e8: ld 2, 24(1)66