diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp --- a/llvm/lib/MC/XCOFFObjectWriter.cpp +++ b/llvm/lib/MC/XCOFFObjectWriter.cpp @@ -193,6 +193,7 @@ uint64_t SymbolTableOffset = 0; uint16_t SectionCount = 0; uint64_t RelocationEntryOffset = 0; + StringRef SourceFileName = ".file"; support::endian::Writer W; std::unique_ptr TargetObjectWriter; @@ -249,7 +250,7 @@ uint64_t writeObject(MCAssembler &, const MCAsmLayout &) override; bool is64Bit() const { return TargetObjectWriter->is64Bit(); } - static bool nameShouldBeInStringTable(const StringRef &); + bool nameShouldBeInStringTable(const StringRef &); void writeSymbolName(const StringRef &); void writeSymbolEntryForCsectMemberLabel(const Symbol &SymbolRef, @@ -267,11 +268,11 @@ void writeSectionForControlSectionEntry(const MCAssembler &Asm, const MCAsmLayout &Layout, const CsectSectionEntry &CsectEntry, - uint32_t &CurrentAddressLocation); + uint64_t &CurrentAddressLocation); void writeSectionForDwarfSectionEntry(const MCAssembler &Asm, const MCAsmLayout &Layout, const DwarfSectionEntry &DwarfEntry, - uint32_t &CurrentAddressLocation); + uint64_t &CurrentAddressLocation); void writeSymbolTable(const MCAsmLayout &Layout); void writeSymbolAuxDwarfEntry(uint32_t LengthOfSectionPortion, uint32_t NumberOfRelocEnt = 0); @@ -486,6 +487,10 @@ Strings.add(XSym->getSymbolTableName()); } + // The first symbol entry is for the source file's name. + if (nameShouldBeInStringTable(SourceFileName)) + Strings.add(SourceFileName); + Strings.finalize(); assignAddressesAndIndices(Layout); } @@ -605,8 +610,7 @@ void XCOFFObjectWriter::writeSections(const MCAssembler &Asm, const MCAsmLayout &Layout) { - assert(!is64Bit() && "Writing 64-bit sections is not yet supported."); - uint32_t CurrentAddressLocation = 0; + uint64_t CurrentAddressLocation = 0; for (const auto *Section : Sections) writeSectionForControlSectionEntry(Asm, Layout, *Section, CurrentAddressLocation); @@ -628,21 +632,17 @@ writeFileHeader(); writeSectionHeaderTable(); - - if (!is64Bit()) { - writeSections(Asm, Layout); - writeRelocations(); - - writeSymbolTable(Layout); - // Write the string table. - Strings.write(W.OS); - } + writeSections(Asm, Layout); + writeRelocations(); + writeSymbolTable(Layout); + // Write the string table. + Strings.write(W.OS); return W.OS.tell() - StartOffset; } bool XCOFFObjectWriter::nameShouldBeInStringTable(const StringRef &SymbolName) { - return SymbolName.size() > XCOFF::NameSize; + return SymbolName.size() > XCOFF::NameSize || is64Bit(); } void XCOFFObjectWriter::writeSymbolName(const StringRef &SymbolName) { @@ -663,8 +663,13 @@ uint16_t SymbolType, uint8_t StorageClass, uint8_t NumberOfAuxEntries) { - writeSymbolName(SymbolName); - W.write(Value); + if (is64Bit()) { + W.write(Value); + W.write(Strings.getOffset(SymbolName)); + } else { + writeSymbolName(SymbolName); + W.write(Value); + } W.write(SectionNumber); // Basic/Derived type. See the description of the n_type field for symbol // table entries for a detailed description. Since we don't yet support @@ -741,7 +746,7 @@ W.write(0); // AuxHeaderSize. No optional header for an object // file that is not to be loaded. W.write(0); // Flags - W.write(0); // SymbolTableEntryCount. Not supported yet. + W.write(1); // SymbolTableEntryCount. Not supported yet. } else { W.write(SymbolTableEntryCount); W.write(0); // AuxHeaderSize. No optional header for an object @@ -772,7 +777,7 @@ writeWord(0); // FileOffsetToLineNumberInfo. Not supported yet. if (is64Bit()) { - W.write(0); // NumberOfRelocations. Not yet supported in 64-bit. + W.write(Sec->RelocationCount); W.write(0); // NumberOfLineNumbers. Not supported yet. W.write(Sec->Flags); W.OS.write_zeros(4); @@ -793,15 +798,15 @@ void XCOFFObjectWriter::writeRelocation(XCOFFRelocation Reloc, const XCOFFSection &Section) { - assert(!is64Bit() && "Writing 64-bit relocation is not yet supported."); if (Section.MCSec->isCsect()) - W.write(Section.Address + Reloc.FixupOffsetInCsect); + writeWord(Section.Address + Reloc.FixupOffsetInCsect); else { // DWARF sections' address is set to 0. assert(Section.MCSec->isDwarfSect() && "unsupport section type!"); - W.write(Reloc.FixupOffsetInCsect); + writeWord(Reloc.FixupOffsetInCsect); } - W.write(Reloc.SymbolTableIndex); + // TODO SymbolTable for XCOFF64 is not yet supported. + W.write(is64Bit() ? 0 : Reloc.SymbolTableIndex); W.write(Reloc.SignAndSize); W.write(Reloc.Type); } @@ -829,17 +834,22 @@ } void XCOFFObjectWriter::writeSymbolTable(const MCAsmLayout &Layout) { - assert(!is64Bit() && "Writing 64-bit symbol table is not yet supported."); // Write symbol 0 as C_FILE. - // FIXME: support 64-bit C_FILE symbol. // The n_name of a C_FILE symbol is the source file's name when no auxiliary // entries are present. The source file's name is alternatively provided by an // auxiliary entry, in which case the n_name of the C_FILE symbol is `.file`. // FIXME: add the real source file's name. - writeSymbolEntry(".file", /*Value=*/0, XCOFF::ReservedSectionNum::N_DEBUG, + writeSymbolEntry(SourceFileName, /*Value=*/0, + XCOFF::ReservedSectionNum::N_DEBUG, /*SymbolType=*/0, XCOFF::C_FILE, /*NumberOfAuxEntries=*/0); + // TODO Writing 64-bit symbol table is not yet supported. Only one entry is + // currently being written, in order to verify the functionality of + // 64-bit relocations. + if (is64Bit()) + return; + for (const auto &Csect : UndefinedCsects) { writeSymbolEntryForControlSection(Csect, XCOFF::ReservedSectionNum::N_UNDEF, Csect.MCSec->getStorageClass()); @@ -884,8 +894,10 @@ for (auto &Csect : *Group) { const size_t CsectRelocCount = Csect.Relocations.size(); - if (CsectRelocCount >= XCOFF::RelocOverflow || - Section->RelocationCount >= XCOFF::RelocOverflow - CsectRelocCount) + // An XCOFF64 file may not contain an overflow section header. + if (!is64Bit() && (CsectRelocCount >= XCOFF::RelocOverflow || + Section->RelocationCount >= + XCOFF::RelocOverflow - CsectRelocCount)) report_fatal_error( "relocation entries overflowed; overflow section is " "not implemented yet"); @@ -908,8 +920,10 @@ return false; Sec->FileOffsetToRelocations = RawPointer; - const uint32_t RelocationSizeInSec = - Sec->RelocationCount * XCOFF::RelocationSerializationSize32; + const uint64_t RelocationSizeInSec = + Sec->RelocationCount * (is64Bit() + ? XCOFF::RelocationSerializationSize64 + : XCOFF::RelocationSerializationSize32); RawPointer += RelocationSizeInSec; if (RawPointer > MaxRawDataSize) report_fatal_error("Relocation data overflowed this object file."); @@ -946,7 +960,7 @@ // The address corrresponds to the address of sections and symbols in the // object file. We place the shared address 0 immediately after the // section header table. - uint32_t Address = 0; + uint64_t Address = 0; // Section indices are 1-based in XCOFF. int32_t SectionIndex = 1; bool HasTDataSection = false; @@ -1083,7 +1097,7 @@ void XCOFFObjectWriter::writeSectionForControlSectionEntry( const MCAssembler &Asm, const MCAsmLayout &Layout, - const CsectSectionEntry &CsectEntry, uint32_t &CurrentAddressLocation) { + const CsectSectionEntry &CsectEntry, uint64_t &CurrentAddressLocation) { // Nothing to write for this Section. if (CsectEntry.Index == SectionEntry::UninitializedIndex) return; @@ -1121,7 +1135,7 @@ // The size of the tail padding in a section is the end virtual address of // the current section minus the the end virtual address of the last csect // in that section. - if (uint32_t PaddingSize = + if (uint64_t PaddingSize = CsectEntry.Address + CsectEntry.Size - CurrentAddressLocation) { W.OS.write_zeros(PaddingSize); CurrentAddressLocation += PaddingSize; @@ -1130,7 +1144,7 @@ void XCOFFObjectWriter::writeSectionForDwarfSectionEntry( const MCAssembler &Asm, const MCAsmLayout &Layout, - const DwarfSectionEntry &DwarfEntry, uint32_t &CurrentAddressLocation) { + const DwarfSectionEntry &DwarfEntry, uint64_t &CurrentAddressLocation) { // There could be a gap (without corresponding zero padding) between // sections. For example DWARF section alignment is bigger than // DefaultSectionAlign. @@ -1138,7 +1152,7 @@ "CurrentAddressLocation should be less than or equal to section " "address."); - if (uint32_t PaddingSize = DwarfEntry.Address - CurrentAddressLocation) + if (uint64_t PaddingSize = DwarfEntry.Address - CurrentAddressLocation) W.OS.write_zeros(PaddingSize); if (DwarfEntry.Size) diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp @@ -71,6 +71,19 @@ return {XCOFF::RelocationType::R_TOCL, SignAndSizeForHalf16}; } } break; + case PPC::fixup_ppc_half16ds: + case PPC::fixup_ppc_half16dq: { + if (IsPCRel) + report_fatal_error("Invalid PC-relative relocation."); + switch (Modifier) { + default: + llvm_unreachable("Unsupported Modifier"); + case MCSymbolRefExpr::VK_None: + return {XCOFF::RelocationType::R_TOC, 15}; + case MCSymbolRefExpr::VK_PPC_L: + return {XCOFF::RelocationType::R_TOCL, 15}; + } + } break; case PPC::fixup_ppc_br24: // Branches are 4 byte aligned, so the 24 bits we encode in // the instruction actually represents a 26 bit offset. @@ -78,15 +91,19 @@ case PPC::fixup_ppc_br24abs: return {XCOFF::RelocationType::R_RBA, EncodedSignednessIndicator | 25}; case FK_Data_4: + case FK_Data_8: + const uint8_t SignAndSizeForFKData = + EncodedSignednessIndicator | + ((unsigned)Fixup.getKind() == FK_Data_4 ? 31 : 63); switch (Modifier) { default: report_fatal_error("Unsupported modifier"); case MCSymbolRefExpr::VK_PPC_AIX_TLSGD: - return {XCOFF::RelocationType::R_TLS, EncodedSignednessIndicator | 31}; + return {XCOFF::RelocationType::R_TLS, SignAndSizeForFKData}; case MCSymbolRefExpr::VK_PPC_AIX_TLSGDM: - return {XCOFF::RelocationType::R_TLSM, EncodedSignednessIndicator | 31}; + return {XCOFF::RelocationType::R_TLSM, SignAndSizeForFKData}; case MCSymbolRefExpr::VK_None: - return {XCOFF::RelocationType::R_POS, EncodedSignednessIndicator | 31}; + return {XCOFF::RelocationType::R_POS, SignAndSizeForFKData}; } } } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll @@ -9,11 +9,12 @@ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64. ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t64.o < %s ; RUN: llvm-readobj --section-headers --file-header %t64.o | \ ; RUN: FileCheck --check-prefix=OBJ64 %s +;; FIXME: the symbol table is not yet supported in XCOFF64. + @ivar = local_unnamed_addr global i32 35, align 4 @llvar = local_unnamed_addr global i64 36, align 8 @svar = local_unnamed_addr global i16 37, align 2 @@ -691,7 +692,7 @@ ; OBJ64-NEXT: NumberOfSections: 3 ; OBJ64-NEXT: TimeStamp: None (0x0) ; OBJ64-NEXT: SymbolTableOffset: 0x170 -; OBJ64-NEXT: SymbolTableEntries: 0 +; OBJ64-NEXT: SymbolTableEntries: 1 ; OBJ64-NEXT: OptionalHeaderSize: 0x0 ; OBJ64-NEXT: Flags: 0x0 ; OBJ64-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll @@ -20,7 +20,10 @@ ; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.ll ; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=XCOFF32 %s -;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64. +;; An XCOFF64 file may not contain an overflow section header. +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t64.o %t.overflow.ll +; RUN: llvm-readobj --section-headers %t64.o | FileCheck --check-prefix=XCOFF64 %s @c = external global i8, align 1 @arr = global [SIZE x i8*] [MACRO], align 8 @@ -41,3 +44,16 @@ ; XCOFF32-NEXT: } ; XCOFF32-NOT: Name: .ovrflo ; XCOFF32-NOT: Type: STYP_OVRFLO + +; XCOFF64: Section { +; XCOFF64: Name: .data +; XCOFF64-NEXT: PhysicalAddress: 0x0 +; XCOFF64-NEXT: VirtualAddress: 0x0 +; XCOFF64-NEXT: Size: 0x7FFF8 +; XCOFF64-NEXT: RawDataOffset: 0xA8 +; XCOFF64-NEXT: RelocationPointer: 0x800A0 +; XCOFF64-NEXT: LineNumberPointer: 0x0 +; XCOFF64-NEXT: NumberOfRelocations: 65535 +; XCOFF64-NEXT: NumberOfLineNumbers: 0 +; XCOFF64-NEXT: Type: STYP_DATA (0x40) +; XCOFF64-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll @@ -1,13 +1,17 @@ ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -mattr=-altivec \ ; RUN: -xcoff-traceback-table=false -data-sections=false -filetype=obj -o %t.o < %s -; RUN: llvm-readobj --section-headers --file-header %t.o | \ -; RUN: FileCheck --check-prefix=OBJ %s +; RUN: llvm-readobj --section-headers --file-header %t.o | FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck --check-prefix=RELOC %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYM %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s ; RUN: llvm-objdump -r %t.o | FileCheck --check-prefix=DIS_REL %s -;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -mattr=-altivec \ +; RUN: -xcoff-traceback-table=false -data-sections=false -filetype=obj -o %t64.o < %s +; RUN: llvm-readobj --section-headers --file-header %t64.o | FileCheck --check-prefix=OBJ64 %s +; RUN: llvm-readobj --relocs --expand-relocs %t64.o | FileCheck --check-prefix=RELOC64 %s + +;; FIXME: the symbol table is not yet supported in XCOFF64. @globalA = global i32 1, align 4 @globalB = global i32 2, align 4 @@ -470,3 +474,114 @@ ; DIS_REL-NEXT: 00000038 R_POS TOC ; DIS_REL-NEXT: 00000040 R_POS globalA ; DIS_REL-NEXT: 00000044 R_POS globalB + +; OBJ64: AddressSize: 64bit +; OBJ64-NEXT: FileHeader { +; OBJ64-NEXT: Magic: 0x1F7 +; OBJ64-NEXT: NumberOfSections: 2 +; OBJ64-NEXT: TimeStamp: None (0x0) +; OBJ64-NEXT: SymbolTableOffset: 0x1B8 +; OBJ64-NEXT: SymbolTableEntries: 1 +; OBJ64-NEXT: OptionalHeaderSize: 0x0 +; OBJ64-NEXT: Flags: 0x0 +; OBJ64-NEXT: } +; OBJ64-NEXT: Sections [ +; OBJ64-NEXT: Section { +; OBJ64-NEXT: Index: 1 +; OBJ64-NEXT: Name: .text +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x40 +; OBJ64-NEXT: RawDataOffset: 0xA8 +; OBJ64-NEXT: RelocationPointer: 0x148 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 3 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_TEXT (0x20) +; OBJ64-NEXT: } +; OBJ64-NEXT: Section { +; OBJ64-NEXT: Index: 2 +; OBJ64-NEXT: Name: .data +; OBJ64-NEXT: PhysicalAddress: 0x40 +; OBJ64-NEXT: VirtualAddress: 0x40 +; OBJ64-NEXT: Size: 0x60 +; OBJ64-NEXT: RawDataOffset: 0xE8 +; OBJ64-NEXT: RelocationPointer: 0x172 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 5 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_DATA (0x40) +; OBJ64-NEXT: } +; OBJ64-NEXT: ] + +; RELOC64: AddressSize: 64bit +; RELOC64-NEXT: Relocations [ +; RELOC64-NEXT: Section (index: 1) .text { +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x10 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: Yes +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 26 +; RELOC64-NEXT: Type: R_RBR (0x1A) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x1A +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 16 +; RELOC64-NEXT: Type: R_TOC (0x3) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x1E +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 16 +; RELOC64-NEXT: Type: R_TOC (0x3) +; RELOC64-NEXT: } +; RELOC64-NEXT: } +; RELOC64-NEXT: Section (index: 2) .data { +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x70 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x78 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x80 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x90 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x98 +; RELOC64-NEXT: Symbol: .file (0) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: } +; RELOC64-NEXT: ] diff --git a/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll b/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll --- a/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll +++ b/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll @@ -3,6 +3,11 @@ ; RUN: -verify-machineinstrs < %s 2>&1 | \ ; RUN: FileCheck %s --check-prefix=OBJ +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s +; RUN: not --crash llc -filetype=obj -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -verify-machineinstrs < %s 2>&1 | \ +; RUN: FileCheck %s --check-prefix=OBJ + @i = global i32 55, align 4 #0 attributes #0 = { "toc-data" } diff --git a/llvm/test/CodeGen/PowerPC/basic-toc-data-extern.ll b/llvm/test/CodeGen/PowerPC/basic-toc-data-extern.ll --- a/llvm/test/CodeGen/PowerPC/basic-toc-data-extern.ll +++ b/llvm/test/CodeGen/PowerPC/basic-toc-data-extern.ll @@ -1,9 +1,12 @@ ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s ; RUN: not --crash llc -filetype=obj -mtriple powerpc-ibm-aix-xcoff \ ; RUN: -verify-machineinstrs < %s 2>&1 | \ -; RUN: FileCheck %s --check-prefix=OBJ32 +; RUN: FileCheck %s --check-prefix=OBJ -;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64. +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s +; RUN: not --crash llc -filetype=obj -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -verify-machineinstrs < %s 2>&1 | \ +; RUN: FileCheck %s --check-prefix=OBJ @i = external global i32, align 4 #0 @@ -17,6 +20,6 @@ ; CHECK: .toc ; CHECK-NEXT: .extern i[TD] -; OBJ32: LLVM ERROR: toc-data not yet supported when writing object files. +; OBJ: LLVM ERROR: toc-data not yet supported when writing object files. attributes #0 = { "toc-data" }