1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
2 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \
4 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s
7 ; The test checks the behavior of PC Relative indirect calls. When using
8 ; PC Relative, TOC save and restore are no longer required. Function pointer
9 ; is passed as a parameter in this test.
11 ; Function Attrs: noinline
12 define dso_local void @IndirectCallExternFuncPtr(ptr nocapture %ptrfunc) {
13 ; CHECK-LABEL: IndirectCallExternFuncPtr:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: mtctr r3
16 ; CHECK-NEXT: mr r12, r3
18 ; CHECK-NEXT: #TC_RETURNr8 ctr
20 tail call void %ptrfunc()
24 define dso_local void @FuncPtrPassAsParam() {
26 tail call void @IndirectCallExternFuncPtr(ptr nonnull @Function)
30 declare void @Function()