diff --git a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp --- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp +++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp @@ -193,6 +193,9 @@ OutMO = GetSymbolRef(MO, AP.GetBlockAddressSymbol(MO.getBlockAddress()), AP, isDarwin); return true; + case MachineOperand::MO_MCSymbol: + OutMO = GetSymbolRef(MO, MO.getMCSymbol(), AP, isDarwin); + return true; case MachineOperand::MO_RegisterMask: return false; } diff --git a/llvm/test/CodeGen/PowerPC/test_call_aix.ll b/llvm/test/CodeGen/PowerPC/test_call_aix.ll --- a/llvm/test/CodeGen/PowerPC/test_call_aix.ll +++ b/llvm/test/CodeGen/PowerPC/test_call_aix.ll @@ -4,6 +4,9 @@ ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -stop-after=machine-cp < %s | \ ; RUN: FileCheck --check-prefix=64BIT %s +; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s + declare void @foo(...) define void @test_call() { @@ -16,6 +19,10 @@ ; 64BIT: BL8_NOP , csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1 ; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 +; CHECK-LABEL: test_call +; CHECK: bl .foo +; CHECK-NEXT: nop + call void bitcast (void (...)* @foo to void ()*)() ret void } @@ -35,6 +42,10 @@ ; 64BIT: BL8 , csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1 ; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1 +; CHECK-LABEL: test_local_call +; CHECK: bl .foo_local +; CHECK-NOT: nop + call void @foo_local() ret void }