Index: llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp =================================================================== --- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp @@ -124,9 +124,9 @@ MCSymbolXCOFF *TCSym = cast(Streamer.getContext().getOrCreateSymbol( XSym->getSymbolTableName() + "[TC]")); + OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n'; if (TCSym->hasRename()) Streamer.emitXCOFFRenameDirective(TCSym, TCSym->getSymbolTableName()); - OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n'; return; } Index: llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll @@ -90,8 +90,8 @@ ; ASM-NEXT: .extern _Renamed..40f_o[DS] ; ASM-NEXT: .toc ; ASM-NEXT: L..C0: -; ASM-NEXT: .rename _Renamed..40f_o[TC],"f@o" ; ASM-NEXT: .tc _Renamed..40f_o[TC],_Renamed..40f_o[DS] +; ASM-NEXT: .rename _Renamed..40f_o[TC],"f@o" ; OBJ: Disassembly of section .text: ; OBJ-EMPTY: