31 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \2; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s3; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \4; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s5 6 7; The test checks the behavior of PC Relative indirect calls. When using8; PC Relative, TOC save and restore are no longer required. Function pointer9; is passed as a parameter in this test.10 11; Function Attrs: noinline12define dso_local void @IndirectCallExternFuncPtr(ptr nocapture %ptrfunc) {13; CHECK-LABEL: IndirectCallExternFuncPtr:14; CHECK: # %bb.0: # %entry15; CHECK-NEXT: mtctr r316; CHECK-NEXT: mr r12, r317; CHECK-NEXT: bctr18; CHECK-NEXT: #TC_RETURNr8 ctr19entry:20 tail call void %ptrfunc()21 ret void22}23 24define dso_local void @FuncPtrPassAsParam() {25entry:26 tail call void @IndirectCallExternFuncPtr(ptr nonnull @Function)27 ret void28}29 30declare void @Function()31