[llvm] 8d6e2c3 - [XCOFF] support writing sections, relocations and symbols for XCOFF64.
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 17 01:28:20 PDT 2022
Author: esmeyi
Date: 2022-05-17T04:27:47-04:00
New Revision: 8d6e2c3e3db1d8a6474b24e42c7b52d788405cbc
URL: https://github.com/llvm/llvm-project/commit/8d6e2c3e3db1d8a6474b24e42c7b52d788405cbc
DIFF: https://github.com/llvm/llvm-project/commit/8d6e2c3e3db1d8a6474b24e42c7b52d788405cbc.diff
LOG: [XCOFF] support writing sections, relocations and symbols for XCOFF64.
This is the second patch to enable the XCOFF64 object writer.
Reviewed By: jhenderson, shchenz
Differential Revision: https://reviews.llvm.org/D122287
Added:
Modified:
llvm/lib/MC/XCOFFObjectWriter.cpp
llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp
llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll
llvm/test/CodeGen/PowerPC/aix-dwarf.ll
llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
llvm/test/CodeGen/PowerPC/aix-extern.ll
llvm/test/CodeGen/PowerPC/aix-func-align.ll
llvm/test/CodeGen/PowerPC/aix-internal.ll
llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll
llvm/test/CodeGen/PowerPC/aix-return55.ll
llvm/test/CodeGen/PowerPC/aix-weak.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll
llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll
llvm/test/CodeGen/PowerPC/basic-toc-data-extern.ll
llvm/test/MC/PowerPC/ppc64-abs-reloc.s
Removed:
################################################################################
diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp
index 76cfc85c87148..9df54d399f6ba 100644
--- a/llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -200,6 +200,7 @@ class XCOFFObjectWriter : public MCObjectWriter {
uint64_t SymbolTableOffset = 0;
uint16_t SectionCount = 0;
uint64_t RelocationEntryOffset = 0;
+ StringRef SourceFileName = ".file";
support::endian::Writer W;
std::unique_ptr<MCXCOFFObjectTargetWriter> TargetObjectWriter;
@@ -256,7 +257,7 @@ class XCOFFObjectWriter : public MCObjectWriter {
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,
@@ -274,18 +275,18 @@ class XCOFFObjectWriter : public MCObjectWriter {
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);
- void writeSymbolAuxCsectEntry(uint32_t SectionOrLength,
+ void writeSymbolAuxDwarfEntry(uint64_t LengthOfSectionPortion,
+ uint64_t NumberOfRelocEnt = 0);
+ void writeSymbolAuxCsectEntry(uint64_t SectionOrLength,
uint8_t SymbolAlignmentAndType,
uint8_t StorageMappingClass);
- void writeSymbolEntry(StringRef SymbolName, uint32_t Value,
+ void writeSymbolEntry(StringRef SymbolName, uint64_t Value,
int16_t SectionNumber, uint16_t SymbolType,
uint8_t StorageClass, uint8_t NumberOfAuxEntries = 1);
void writeRelocations();
@@ -493,6 +494,10 @@ void XCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
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);
}
@@ -612,8 +617,7 @@ void XCOFFObjectWriter::recordRelocation(MCAssembler &Asm,
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);
@@ -635,21 +639,17 @@ uint64_t XCOFFObjectWriter::writeObject(MCAssembler &Asm,
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) {
@@ -665,13 +665,18 @@ void XCOFFObjectWriter::writeSymbolName(const StringRef &SymbolName) {
}
}
-void XCOFFObjectWriter::writeSymbolEntry(StringRef SymbolName, uint32_t Value,
+void XCOFFObjectWriter::writeSymbolEntry(StringRef SymbolName, uint64_t Value,
int16_t SectionNumber,
uint16_t SymbolType,
uint8_t StorageClass,
uint8_t NumberOfAuxEntries) {
- writeSymbolName(SymbolName);
- W.write<uint32_t>(Value);
+ if (is64Bit()) {
+ W.write<uint64_t>(Value);
+ W.write<uint32_t>(Strings.getOffset(SymbolName));
+ } else {
+ writeSymbolName(SymbolName);
+ W.write<uint32_t>(Value);
+ }
W.write<int16_t>(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
@@ -686,24 +691,36 @@ void XCOFFObjectWriter::writeSymbolEntry(StringRef SymbolName, uint32_t Value,
W.write<uint8_t>(NumberOfAuxEntries);
}
-void XCOFFObjectWriter::writeSymbolAuxCsectEntry(uint32_t SectionOrLength,
+void XCOFFObjectWriter::writeSymbolAuxCsectEntry(uint64_t SectionOrLength,
uint8_t SymbolAlignmentAndType,
uint8_t StorageMappingClass) {
- W.write<uint32_t>(SectionOrLength);
+ W.write<uint32_t>(is64Bit() ? Lo_32(SectionOrLength) : SectionOrLength);
W.write<uint32_t>(0); // ParameterHashIndex
W.write<uint16_t>(0); // TypeChkSectNum
W.write<uint8_t>(SymbolAlignmentAndType);
W.write<uint8_t>(StorageMappingClass);
- W.write<uint32_t>(0); // StabInfoIndex
- W.write<uint16_t>(0); // StabSectNum
+ if (is64Bit()) {
+ W.write<uint32_t>(Hi_32(SectionOrLength));
+ W.OS.write_zeros(1); // Reserved
+ W.write<uint8_t>(XCOFF::AUX_CSECT);
+ } else {
+ W.write<uint32_t>(0); // StabInfoIndex
+ W.write<uint16_t>(0); // StabSectNum
+ }
}
void XCOFFObjectWriter::writeSymbolAuxDwarfEntry(
- uint32_t LengthOfSectionPortion, uint32_t NumberOfRelocEnt) {
- W.write<uint32_t>(LengthOfSectionPortion);
- W.OS.write_zeros(4); // Reserved
- W.write<uint32_t>(NumberOfRelocEnt);
- W.OS.write_zeros(6); // Reserved
+ uint64_t LengthOfSectionPortion, uint64_t NumberOfRelocEnt) {
+ writeWord(LengthOfSectionPortion);
+ if (!is64Bit())
+ W.OS.write_zeros(4); // Reserved
+ writeWord(NumberOfRelocEnt);
+ if (is64Bit()) {
+ W.OS.write_zeros(1); // Reserved
+ W.write<uint8_t>(XCOFF::AUX_SECT);
+ } else {
+ W.OS.write_zeros(6); // Reserved
+ }
}
void XCOFFObjectWriter::writeSymbolEntryForCsectMemberLabel(
@@ -749,7 +766,7 @@ void XCOFFObjectWriter::writeFileHeader() {
W.write<uint16_t>(0); // AuxHeaderSize. No optional header for an object
// file that is not to be loaded.
W.write<uint16_t>(0); // Flags
- W.write<int32_t>(0); // SymbolTableEntryCount. Not supported yet.
+ W.write<int32_t>(SymbolTableEntryCount);
} else {
W.write<int32_t>(SymbolTableEntryCount);
W.write<uint16_t>(0); // AuxHeaderSize. No optional header for an object
@@ -780,7 +797,7 @@ void XCOFFObjectWriter::writeSectionHeaderTable() {
writeWord(0); // FileOffsetToLineNumberInfo. Not supported yet.
if (is64Bit()) {
- W.write<uint32_t>(0); // NumberOfRelocations. Not yet supported in 64-bit.
+ W.write<uint32_t>(Sec->RelocationCount);
W.write<uint32_t>(0); // NumberOfLineNumbers. Not supported yet.
W.write<int32_t>(Sec->Flags);
W.OS.write_zeros(4);
@@ -801,13 +818,12 @@ void XCOFFObjectWriter::writeSectionHeaderTable() {
void XCOFFObjectWriter::writeRelocation(XCOFFRelocation Reloc,
const XCOFFSection &Section) {
- assert(!is64Bit() && "Writing 64-bit relocation is not yet supported.");
if (Section.MCSec->isCsect())
- W.write<uint32_t>(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<uint32_t>(Reloc.FixupOffsetInCsect);
+ writeWord(Reloc.FixupOffsetInCsect);
}
W.write<uint32_t>(Reloc.SymbolTableIndex);
W.write<uint8_t>(Reloc.SignAndSize);
@@ -837,14 +853,13 @@ void XCOFFObjectWriter::writeRelocations() {
}
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);
@@ -892,8 +907,10 @@ void XCOFFObjectWriter::finalizeSectionInfo() {
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");
@@ -916,8 +933,10 @@ void XCOFFObjectWriter::finalizeSectionInfo() {
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.");
@@ -954,7 +973,7 @@ void XCOFFObjectWriter::assignAddressesAndIndices(const MCAsmLayout &Layout) {
// 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;
@@ -1091,7 +1110,7 @@ void XCOFFObjectWriter::assignAddressesAndIndices(const MCAsmLayout &Layout) {
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;
@@ -1129,7 +1148,7 @@ void XCOFFObjectWriter::writeSectionForControlSectionEntry(
// 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;
@@ -1138,7 +1157,7 @@ void XCOFFObjectWriter::writeSectionForControlSectionEntry(
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.
@@ -1146,7 +1165,7 @@ void XCOFFObjectWriter::writeSectionForDwarfSectionEntry(
"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
index 64e11dbc1efcb..729cb35cbebcf 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp
@@ -71,6 +71,19 @@ std::pair<uint8_t, uint8_t> PPCXCOFFObjectWriter::getRelocTypeAndSignSize(
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 @@ std::pair<uint8_t, uint8_t> PPCXCOFFObjectWriter::getRelocTypeAndSignSize(
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-available-externally-linkage.ll b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll
index 7b2f948afb2a4..176cbffa813e6 100644
--- a/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll
@@ -1,36 +1,35 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec < %s | \
-; RUN: FileCheck %s
+; RUN: -mattr=-altivec < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec < %s | \
-; RUN: FileCheck %s
+; RUN: -mattr=-altivec < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | \
-; RUN: FileCheck --check-prefix=XCOFF32 %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=XCOFF,XCOFF32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=XCOFF,XCOFF64 %s
@_ZN3Foo1aE = available_externally constant i32 -1
; CHECK: .extern _ZN3Foo1aE[UA]
-; XCOFF32: Index: [[#Index:]]{{.*}}{{[[:space:]] *}}Name: _ZN3Foo1aE
-; XCOFF32-NEXT: Value (RelocatableAddress): 0x0
-; XCOFF32-NEXT: Section: N_UNDEF
-; XCOFF32-NEXT: Type: 0x0
-; XCOFF32-NEXT: StorageClass: C_EXT (0x2)
-; XCOFF32-NEXT: NumberOfAuxEntries: 1
-; XCOFF32-NEXT: CSECT Auxiliary Entry {
-; XCOFF32-NEXT: Index: [[#Index+1]]
-; XCOFF32-NEXT: SectionLen: 0
-; XCOFF32-NEXT: ParameterHashIndex: 0x0
-; XCOFF32-NEXT: TypeChkSectNum: 0x0
-; XCOFF32-NEXT: SymbolAlignmentLog2: 0
-; XCOFF32-NEXT: SymbolType: XTY_ER (0x0)
-; XCOFF32-NEXT: StorageMappingClass: XMC_UA (0x4)
-; XCOFF32-NEXT: StabInfoIndex: 0x0
-; XCOFF32-NEXT: StabSectNum: 0x0
-; XCOFF32-NEXT: }
+; XCOFF: Index: [[#Index:]]{{.*}}{{[[:space:]] *}}Name: _ZN3Foo1aE
+; XCOFF-NEXT: Value (RelocatableAddress): 0x0
+; XCOFF-NEXT: Section: N_UNDEF
+; XCOFF-NEXT: Type: 0x0
+; XCOFF-NEXT: StorageClass: C_EXT (0x2)
+; XCOFF-NEXT: NumberOfAuxEntries: 1
+; XCOFF-NEXT: CSECT Auxiliary Entry {
+; XCOFF-NEXT: Index: [[#Index+1]]
+; XCOFF-NEXT: SectionLen: 0
+; XCOFF-NEXT: ParameterHashIndex: 0x0
+; XCOFF-NEXT: TypeChkSectNum: 0x0
+; XCOFF-NEXT: SymbolAlignmentLog2: 0
+; XCOFF-NEXT: SymbolType: XTY_ER (0x0)
+; XCOFF-NEXT: StorageMappingClass: XMC_UA (0x4)
+; XCOFF32: StabInfoIndex: 0x0
+; XCOFF32-NEXT: StabSectNum: 0x0
+; XCOFF64: Auxiliary Type: AUX_CSECT (0xFB)
diff --git a/llvm/test/CodeGen/PowerPC/aix-dwarf.ll b/llvm/test/CodeGen/PowerPC/aix-dwarf.ll
index 263cbc668a90b..485202d180641 100644
--- a/llvm/test/CodeGen/PowerPC/aix-dwarf.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-dwarf.ll
@@ -1,9 +1,12 @@
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefix=SEC
-; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
+; RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefixes=SEC,SEC32
; RUN: llvm-objdump -r %t.o | FileCheck %s --check-prefix=RELO
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --section-headers %t64.o | FileCheck %s --check-prefixes=SEC,SEC64
+; RUN: llvm-objdump -r %t64.o | FileCheck %s --check-prefix=RELO64
+
; This file is copied from test/DebugInfo/XCOFF/empty.ll.
; In this test, we focus on XCOFF related formats, like section headers,
; relocation entries.
@@ -37,15 +40,15 @@ entry:
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !DILocation(line: 3, column: 3, scope: !8)
-; SEC: AddressSize: 32bit
-; SEC-NEXT: Sections [
+; SEC: Sections [
; SEC-NEXT: Section {
; SEC-NEXT: Index: 1
; SEC-NEXT: Name: .text
; SEC-NEXT: PhysicalAddress: 0x0
; SEC-NEXT: VirtualAddress: 0x0
; SEC-NEXT: Size: 0x28
-; SEC-NEXT: RawDataOffset: 0xDC
+; SEC32-NEXT: RawDataOffset: 0xDC
+; SEC64-NEXT: RawDataOffset: 0x180
; SEC-NEXT: RelocationPointer: 0x0
; SEC-NEXT: LineNumberPointer: 0x0
; SEC-NEXT: NumberOfRelocations: 0
@@ -57,9 +60,12 @@ entry:
; SEC-NEXT: Name: .data
; SEC-NEXT: PhysicalAddress: 0x28
; SEC-NEXT: VirtualAddress: 0x28
-; SEC-NEXT: Size: 0xC
-; SEC-NEXT: RawDataOffset: 0x104
-; SEC-NEXT: RelocationPointer: 0x1D8
+; SEC32-NEXT: Size: 0xC
+; SEC32-NEXT: RawDataOffset: 0x104
+; SEC32-NEXT: RelocationPointer: 0x1D8
+; SEC64-NEXT: Size: 0x18
+; SEC64-NEXT: RawDataOffset: 0x1A8
+; SEC64-NEXT: RelocationPointer: 0x2B0
; SEC-NEXT: LineNumberPointer: 0x0
; SEC-NEXT: NumberOfRelocations: 2
; SEC-NEXT: NumberOfLineNumbers: 0
@@ -71,7 +77,8 @@ entry:
; SEC-NEXT: PhysicalAddress: 0x0
; SEC-NEXT: VirtualAddress: 0x0
; SEC-NEXT: Size: 0x36
-; SEC-NEXT: RawDataOffset: 0x110
+; SEC32-NEXT: RawDataOffset: 0x110
+; SEC64-NEXT: RawDataOffset: 0x1C0
; SEC-NEXT: RelocationPointer: 0x0
; SEC-NEXT: LineNumberPointer: 0x0
; SEC-NEXT: NumberOfRelocations: 0
@@ -83,9 +90,12 @@ entry:
; SEC-NEXT: Name: .dwinfo
; SEC-NEXT: PhysicalAddress: 0x0
; SEC-NEXT: VirtualAddress: 0x0
-; SEC-NEXT: Size: 0x57
-; SEC-NEXT: RawDataOffset: 0x148
-; SEC-NEXT: RelocationPointer: 0x1EC
+; SEC32-NEXT: Size: 0x57
+; SEC32-NEXT: RawDataOffset: 0x148
+; SEC32-NEXT: RelocationPointer: 0x1EC
+; SEC64-NEXT: Size: 0x6F
+; SEC64-NEXT: RawDataOffset: 0x1F8
+; SEC64-NEXT: RelocationPointer: 0x2CC
; SEC-NEXT: LineNumberPointer: 0x0
; SEC-NEXT: NumberOfRelocations: 4
; SEC-NEXT: NumberOfLineNumbers: 0
@@ -96,9 +106,12 @@ entry:
; SEC-NEXT: Name: .dwline
; SEC-NEXT: PhysicalAddress: 0x0
; SEC-NEXT: VirtualAddress: 0x0
-; SEC-NEXT: Size: 0x36
-; SEC-NEXT: RawDataOffset: 0x1A0
-; SEC-NEXT: RelocationPointer: 0x214
+; SEC32-NEXT: Size: 0x36
+; SEC32-NEXT: RawDataOffset: 0x1A0
+; SEC32-NEXT: RelocationPointer: 0x214
+; SEC64-NEXT: Size: 0x46
+; SEC64-NEXT: RawDataOffset: 0x268
+; SEC64-NEXT: RelocationPointer: 0x304
; SEC-NEXT: LineNumberPointer: 0x0
; SEC-NEXT: NumberOfRelocations: 1
; SEC-NEXT: NumberOfLineNumbers: 0
@@ -115,3 +128,13 @@ entry:
; RELO: RELOCATION RECORDS FOR [.dwline]:
; RELO-NEXT: OFFSET TYPE VALUE
; RELO-NEXT: 00000000 R_POS .text
+
+; RELO64: RELOCATION RECORDS FOR [.dwinfo]:
+; RELO64-NEXT: OFFSET TYPE VALUE
+; RELO64-NEXT: 000000000000000e R_POS .dwabrev
+; RELO64-NEXT: 000000000000000b R_POS .dwline
+; RELO64-NEXT: 0000000000000041 R_POS .text
+; RELO64-NEXT: 000000000000004e R_POS .text
+; RELO64: RELOCATION RECORDS FOR [.dwline]:
+; RELO64-NEXT: OFFSET TYPE VALUE
+; RELO64-NEXT: 000000000000000c R_POS .text
diff --git a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
index c9aca7ca22222..e8044f3735a72 100644
--- a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
@@ -1,14 +1,20 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
+; RUN: FileCheck --check-prefixes=COMMON,BIT32 %s
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
+; RUN: FileCheck --check-prefixes=COMMON,BIT64 %s
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
+; RUN: -filetype=obj -o %t.o < %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
@foo_ext_weak_p = global void (...)* bitcast (void ()* @foo_ext_weak_ref to void (...)*)
@b_w = extern_weak global i32
@@ -84,8 +90,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -104,8 +111,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -124,8 +132,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_UA (0x4)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -144,8 +153,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -164,8 +174,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -184,8 +195,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 4
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -204,8 +216,9 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -218,14 +231,17 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+15]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -244,34 +260,40 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+18]]
; CHECKSYM-NEXT: Name: main
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x54
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x54
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x58
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+19]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+20]]
; CHECKSYM-NEXT: Name: TOC
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x60
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
@@ -284,48 +306,57 @@ declare extern_weak void @foo_ext_weak(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+22]]
; CHECKSYM-NEXT: Name: foo_ext_weak_p
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x60
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x60
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+23]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+24]]
; CHECKSYM-NEXT: Name: b_w
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x64
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x64
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+25]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: ]
diff --git a/llvm/test/CodeGen/PowerPC/aix-extern.ll b/llvm/test/CodeGen/PowerPC/aix-extern.ll
index e63300e2ac442..1ac6d2270ed1b 100644
--- a/llvm/test/CodeGen/PowerPC/aix-extern.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-extern.ll
@@ -1,14 +1,20 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT32 %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
+; RUN: FileCheck --check-prefixes=COMMON,BIT32 %s
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | FileCheck --check-prefixes=COMMON,BIT64 %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
+; RUN: FileCheck --check-prefixes=COMMON,BIT64 %s
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
-; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
+; RUN: -filetype=obj -o %t.o < %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
@bar_p = global i32 (...)* @bar_ref, align 4
@b_e = external global i32, align 4
@@ -107,8 +113,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -127,8 +134,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -147,8 +155,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -167,8 +176,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_UA (0x4)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -187,8 +197,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -207,8 +218,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 4
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -227,8 +239,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -247,8 +260,9 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -261,14 +275,17 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+17]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -287,54 +304,64 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+20]]
; CHECKSYM-NEXT: Name: foo
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x74
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x74
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+21]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+22]]
; CHECKSYM-NEXT: Name: main
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x80
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x80
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x90
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+23]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+24]]
; CHECKSYM-NEXT: Name: TOC
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xA8
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
@@ -347,48 +374,57 @@ declare i32 @bar_extern(i32*)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+26]]
; CHECKSYM-NEXT: Name: b_e
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xA8
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+27]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+28]]
; CHECKSYM-NEXT: Name: bar_p
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x90
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x90
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xB0
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+29]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: ]
diff --git a/llvm/test/CodeGen/PowerPC/aix-func-align.ll b/llvm/test/CodeGen/PowerPC/aix-func-align.ll
index bdafb5469d13e..556ef30544538 100644
--- a/llvm/test/CodeGen/PowerPC/aix-func-align.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-func-align.ll
@@ -7,9 +7,11 @@
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
; RUN: -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
+; RUN: -xcoff-traceback-table=false -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYMS,SYMS64 %s
define i32 @foo() align 32 {
entry:
@@ -41,7 +43,8 @@ entry:
; SYMS-NEXT: SymbolAlignmentLog2: 6
; SYMS-NEXT: SymbolType: XTY_SD (0x1)
; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
diff --git a/llvm/test/CodeGen/PowerPC/aix-internal.ll b/llvm/test/CodeGen/PowerPC/aix-internal.ll
index 790315e0210e7..c343a197397e1 100644
--- a/llvm/test/CodeGen/PowerPC/aix-internal.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-internal.ll
@@ -1,36 +1,38 @@
; RUN: llc -mtriple powerpc-ibm-aix -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec \
-; RUN: -filetype=obj -o %t.o < %s
+; RUN: -filetype=obj -o %t.o < %s
; RUN: llvm-readobj --syms %t.o | FileCheck %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -mtriple powerpc64-ibm-aix -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck %s
define internal i32 @foo() {
ret i32 1
}
-; CHECK: Symbol {
-; CHECK: Name: .foo
-; CHECK-NEXT: Value (RelocatableAddress):
-; CHECK-NEXT: Section: .text
-; CHECK-NEXT: Type: 0x0
-; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
+; CHECK: Symbol {
+; CHECK: Name: .foo
+; CHECK-NEXT: Value (RelocatableAddress):
+; CHECK-NEXT: Section: .text
+; CHECK-NEXT: Type: 0x0
+; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
-; CHECK: Symbol {
-; CHECK-NEXT: Index: [[#INDX:]]
-; CHECK-NEXT: Name: foo
-; CHECK-NEXT: Value (RelocatableAddress):
-; CHECK-NEXT: Section: .data
-; CHECK-NEXT: Type: 0x0
-; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
-; CHECK-NEXT: NumberOfAuxEntries: 1
-; CHECK-NEXT: CSECT Auxiliary Entry {
-; CHECK-NEXT: Index: [[#INDX+1]]
-; CHECK-NEXT: SectionLen: 12
-; CHECK-NEXT: ParameterHashIndex:
-; CHECK-NEXT: TypeChkSectNum:
-; CHECK-NEXT: SymbolAlignmentLog2:
-; CHECK-NEXT: SymbolType: XTY_SD (0x1)
-; CHECK-NEXT: StorageMappingClass: XMC_DS (0xA)
+; CHECK: Symbol {
+; CHECK-NEXT: Index: [[#INDX:]]
+; CHECK-NEXT: Name: foo
+; CHECK-NEXT: Value (RelocatableAddress):
+; CHECK-NEXT: Section: .data
+; CHECK-NEXT: Type: 0x0
+; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
+; CHECK-NEXT: NumberOfAuxEntries: 1
+; CHECK-NEXT: CSECT Auxiliary Entry {
+; CHECK-NEXT: Index: [[#INDX+1]]
+; CHECK-NEXT: SectionLen:
+; CHECK-NEXT: ParameterHashIndex:
+; CHECK-NEXT: TypeChkSectNum:
+; CHECK-NEXT: SymbolAlignmentLog2:
+; CHECK-NEXT: SymbolType: XTY_SD (0x1)
+; CHECK-NEXT: StorageMappingClass: XMC_DS (0xA)
; Make sure no label is emitted.
; CHECK-NOT: Name: foo
diff --git a/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll b/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll
index 2ff48aa0a6d76..1921dfb745f1d 100644
--- a/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll
@@ -6,10 +6,13 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s
-; RUN: llvm-objdump -r -d --symbol-description %t.o | FileCheck --check-prefix=CHECKRELOC %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
+; RUN: llvm-objdump -r -d --symbol-description %t.o | FileCheck --check-prefixes=CHECKRELOC,CHECKRELOC32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
+; RUN: llvm-objdump -r -d --symbol-description %t64.o | FileCheck --check-prefixes=CHECKRELOC,CHECKRELOC64 %s
%struct.S = type { i32, i32 }
@@ -60,18 +63,25 @@ declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg)
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_ER (0x0)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
-; CHECKRELOC: 00000000 (idx: 7) .bar:
+; CHECKRELOC32: 00000000 (idx: 7) .bar:
+; CHECKRELOC64: 0000000000000000 (idx: 7) .bar:
; CHECKRELOC-NEXT: 0: 7c 08 02 a6 mflr 0
-; CHECKRELOC-NEXT: 4: 90 01 00 08 stw 0, 8(1)
-; CHECKRELOC-NEXT: 8: 94 21 ff c0 stwu 1, -64(1)
-; CHECKRELOC-NEXT: c: 80 62 00 00 lwz 3, 0(2)
-; CHECKRELOC-NEXT: 0000000e: R_TOC (idx: 13) s[TC]
+; CHECKRELOC32-NEXT: 4: 90 01 00 08 stw 0, 8(1)
+; CHECKRELOC32-NEXT: 8: 94 21 ff c0 stwu 1, -64(1)
+; CHECKRELOC32-NEXT: c: 80 62 00 00 lwz 3, 0(2)
+; CHECKRELOC64-NEXT: 4: f8 01 00 10 std 0, 16(1)
+; CHECKRELOC64-NEXT: 8: f8 21 ff 91 stdu 1, -112(1)
+; CHECKRELOC64-NEXT: c: e8 62 00 00 ld 3, 0(2)
+; CHECKRELOC32-NEXT: 0000000e: R_TOC (idx: 13) s[TC]
+; CHECKRELOC64-NEXT: 000000000000000e: R_TOC (idx: 13) s[TC]
; CHECKRELOC-NEXT: 10: 80 83 00 04 lwz 4, 4(3)
; CHECKRELOC-NEXT: 14: 7c 85 23 78 mr 5, 4
; CHECKRELOC-NEXT: 18: 4b ff ff e9 bl 0x0
-; CHECKRELOC-NEXT: 00000018: R_RBR (idx: 1) .memset[PR]
+; CHECKRELOC32-NEXT: 00000018: R_RBR (idx: 1) .memset[PR]
+; CHECKRELOC64-NEXT: 0000000000000018: R_RBR (idx: 1) .memset[PR]
diff --git a/llvm/test/CodeGen/PowerPC/aix-return55.ll b/llvm/test/CodeGen/PowerPC/aix-return55.ll
index 3328786f9e03d..384480375a2be 100644
--- a/llvm/test/CodeGen/PowerPC/aix-return55.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-return55.ll
@@ -2,10 +2,14 @@
; RUN: -verify-machineinstrs -data-sections=false -xcoff-traceback-table=false < %s | FileCheck %s
; RUN: llc -mcpu=pwr4 -mattr=-altivec -mtriple=powerpc-ibm-aix-xcoff \
; RUN: -verify-machineinstrs -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
-; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s
-; RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=CHECKSECT %s
+; RUN: llvm-objdump -D %t.o | FileCheck --check-prefixes=CHECKOBJ,CHECKOBJ32 %s
+; RUN: llvm-readobj -S %t.o | FileCheck --check-prefixes=CHECKSECT,CHECKSECT32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -mcpu=pwr4 -mattr=-altivec -mtriple=powerpc64-ibm-aix-xcoff \
+; RUN: -verify-machineinstrs -data-sections=false -xcoff-traceback-table=false \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-objdump -D %t64.o | FileCheck --check-prefixes=CHECKOBJ,CHECKOBJ64 %s
+; RUN: llvm-readobj -S %t64.o | FileCheck --check-prefixes=CHECKSECT,CHECKSECT64 %s
@a = global i64 320255973571806, align 8
@d = global double 5.000000e+00, align 8
@@ -19,24 +23,31 @@ entry:
; CHECK: blr
}
-;CHECKOBJ: 00000000 <.foo>:
+;CHECKOBJ32: 00000000 <.foo>:
+;CHECKOBJ64: 0000000000000000 <.foo>:
;CHECKOBJ-NEXT: 0: 38 60 00 37 li 3, 55
;CHECKOBJ-NEXT: 4: 4e 80 00 20 blr{{[[:space:]] *}}
-;CHECKOBJ-NEXT: 00000008 <.rodata.str1.1>:
+;CHECKOBJ32-NEXT: 00000008 <.rodata.str1.1>:
+;CHECKOBJ64-NEXT: 0000000000000008 <.rodata.str1.1>:
;CHECKOBJ-NEXT: 8: 68 65 6c 6c xori 5, 3, 27756
;CHECKOBJ-NEXT: c: 6f 77 6f 72 xoris 23, 27, 28530
;CHECKOBJ-NEXT: 10: 0a 00 00 00 tdlti 0, 0{{[[:space:]] *}}
-;CHECKOBJ-NEXT: Disassembly of section .data:{{[[:space:]] *}}
-;CHECKOBJ-NEXT: 00000018 <a>:
+;CHECKOBJ-NEXT: Disassembly of section .data:{{[[:space:]] *}}
+;CHECKOBJ32-NEXT: 00000018 <a>:
+;CHECKOBJ64-NEXT: 0000000000000018 <a>:
;CHECKOBJ-NEXT: 18: 00 01 23 45 <unknown>
;CHECKOBJ-NEXT: 1c: 67 8a bc de oris 10, 28, 48350{{[[:space:]] *}}
-;CHECKOBJ-NEXT: 00000020 <d>:
+;CHECKOBJ32-NEXT: 00000020 <d>:
+;CHECKOBJ64-NEXT: 0000000000000020 <d>:
;CHECKOBJ-NEXT: 20: 40 14 00 00 bdnzf 20, 0x20
;CHECKOBJ-NEXT: 24: 00 00 00 00 <unknown>{{[[:space:]] *}}
-;CHECKOBJ-NEXT: 00000028 <foo>:
-;CHECKOBJ-NEXT: 28: 00 00 00 00 <unknown>
-;CHECKOBJ-NEXT: 2c: 00 00 00 34 <unknown>
-;CHECKOBJ-NEXT: 30: 00 00 00 00 <unknown>
+;CHECKOBJ32-NEXT: 00000028 <foo>:
+;CHECKOBJ32-NEXT: 28: 00 00 00 00 <unknown>
+;CHECKOBJ32-NEXT: 2c: 00 00 00 34 <unknown>
+;CHECKOBJ32-NEXT: 30: 00 00 00 00 <unknown>
+;CHECKOBJ64-NEXT: 0000000000000028 <foo>:
+;CHECKOBJ64-NEXT: ...
+;CHECKOBJ64-NEXT: 34: 00 00 00 40 <unknown>
;CHECKSECT: Sections [
;CHECKSECT-NEXT: Section {
@@ -45,7 +56,8 @@ entry:
;CHECKSECT-NEXT: PhysicalAddress: 0x0
;CHECKSECT-NEXT: VirtualAddress: 0x0
;CHECKSECT-NEXT: Size: 0x14
-;CHECKSECT-NEXT: RawDataOffset: 0x64
+;CHECKSECT32-NEXT: RawDataOffset: 0x64
+;CHECKSECT64-NEXT: RawDataOffset: 0xA8
;CHECKSECT-NEXT: RelocationPointer: 0x0
;CHECKSECT-NEXT: LineNumberPointer: 0x0
;CHECKSECT-NEXT: NumberOfRelocations: 0
@@ -57,9 +69,12 @@ entry:
;CHECKSECT-NEXT: Name: .data
;CHECKSECT-NEXT: PhysicalAddress: 0x18
;CHECKSECT-NEXT: VirtualAddress: 0x18
-;CHECKSECT-NEXT: Size: 0x1C
-;CHECKSECT-NEXT: RawDataOffset: 0x78
-;CHECKSECT-NEXT: RelocationPointer: 0x94
+;CHECKSECT32-NEXT: Size: 0x1C
+;CHECKSECT32-NEXT: RawDataOffset: 0x78
+;CHECKSECT32-NEXT: RelocationPointer: 0x94
+;CHECKSECT64-NEXT: Size: 0x28
+;CHECKSECT64-NEXT: RawDataOffset: 0xBC
+;CHECKSECT64-NEXT: RelocationPointer: 0xE4
;CHECKSECT-NEXT: LineNumberPointer: 0x0
;CHECKSECT-NEXT: NumberOfRelocations: 2
;CHECKSECT-NEXT: NumberOfLineNumbers: 0
diff --git a/llvm/test/CodeGen/PowerPC/aix-weak.ll b/llvm/test/CodeGen/PowerPC/aix-weak.ll
index e23ebf0bd5d63..bdf8cf799fd7f 100644
--- a/llvm/test/CodeGen/PowerPC/aix-weak.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-weak.ll
@@ -6,9 +6,11 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -xcoff-traceback-table=false -mcpu=pwr4 \
; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -xcoff-traceback-table=false -mcpu=pwr4 \
+; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=CHECKSYM,CHECKSYM64 %s
@foo_weak_p = global void (...)* bitcast (void ()* @foo_ref_weak to void (...)*), align 4
@b = weak global i32 0, align 4
@@ -123,8 +125,9 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 4
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -143,8 +146,9 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -163,8 +167,9 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -183,8 +188,9 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -197,14 +203,17 @@ entry:
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+9]]
-; CHECKSYM-NEXT: SectionLen: 8
+; CHECKSYM32-NEXT: SectionLen: 8
+; CHECKSYM64-NEXT: SectionLen: 12
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
@@ -223,14 +232,16 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+12]]
; CHECKSYM-NEXT: Name: b
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x8C
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x90
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
@@ -243,74 +254,88 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 0
; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2)
; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+14]]
; CHECKSYM-NEXT: Name: foo_weak
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x90
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x90
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x98
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+15]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+16]]
; CHECKSYM-NEXT: Name: foo_ref_weak
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0x9C
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0x9C
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xB0
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+17]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+18]]
; CHECKSYM-NEXT: Name: main
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0xA8
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0xA8
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xC8
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_EXT (0x2)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+19]]
-; CHECKSYM-NEXT: SectionLen: 12
+; CHECKSYM32-NEXT: SectionLen: 12
+; CHECKSYM64-NEXT: SectionLen: 24
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+20]]
; CHECKSYM-NEXT: Name: TOC
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0xB4
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0xB4
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE0
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
@@ -323,48 +348,57 @@ entry:
; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+22]]
; CHECKSYM-NEXT: Name: foo_weak_p
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0xB4
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0xB4
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE0
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+23]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: Symbol {
; CHECKSYM-NEXT: Index: [[#Index+24]]
; CHECKSYM-NEXT: Name: b
-; CHECKSYM-NEXT: Value (RelocatableAddress): 0xB8
+; CHECKSYM32-NEXT: Value (RelocatableAddress): 0xB8
+; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE8
; CHECKSYM-NEXT: Section: .data
; CHECKSYM-NEXT: Type: 0x0
; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECKSYM-NEXT: NumberOfAuxEntries: 1
; CHECKSYM-NEXT: CSECT Auxiliary Entry {
; CHECKSYM-NEXT: Index: [[#Index+25]]
-; CHECKSYM-NEXT: SectionLen: 4
+; CHECKSYM32-NEXT: SectionLen: 4
+; CHECKSYM64-NEXT: SectionLen: 8
; CHECKSYM-NEXT: ParameterHashIndex: 0x0
; CHECKSYM-NEXT: TypeChkSectNum: 0x0
-; CHECKSYM-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM32-NEXT: SymbolAlignmentLog2: 2
+; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3
; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1)
; CHECKSYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; CHECKSYM-NEXT: StabInfoIndex: 0x0
-; CHECKSYM-NEXT: StabSectNum: 0x0
+; CHECKSYM32-NEXT: StabInfoIndex: 0x0
+; CHECKSYM32-NEXT: StabSectNum: 0x0
+; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: }
; CHECKSYM-NEXT: ]
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll
index fd94cc434405c..a5481fe7b9694 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll
@@ -4,7 +4,8 @@
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %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 -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefix=SYMS %s
@a = external global i32, align 4
@b = external global i64, align 8
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
index a59863423b436..588994618d326 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
@@ -7,12 +7,12 @@
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -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 --syms %t.o | FileCheck --check-prefix=SYMS %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS32 %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
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYMS,SYMS64 %s
@ivar = local_unnamed_addr global i32 35, align 4
@llvar = local_unnamed_addr global i64 36, align 8
@@ -205,10 +205,6 @@
; OBJ-NEXT: }
; OBJ: ]
-; SYMS: File: {{.*}}aix-xcoff-data.ll.tmp.o
-; SYMS-NEXT: Format: aixcoff-rs6000
-; SYMS-NEXT: Arch: powerpc
-; SYMS-NEXT: AddressSize: 32bit
; SYMS: Symbols [
; SYMS-NEXT: Symbol {
; SYMS-NEXT: Index: 0
@@ -236,8 +232,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 2
; SYMS-NEXT: SymbolType: XTY_SD (0x1)
; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -257,8 +254,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 5
; SYMS-NEXT: SymbolType: XTY_SD (0x1)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -278,8 +276,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -299,8 +298,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -320,8 +320,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -341,8 +342,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -362,8 +364,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -383,8 +386,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -404,8 +408,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -425,8 +430,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -446,8 +452,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -467,8 +474,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -488,8 +496,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -509,8 +518,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -530,8 +540,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -551,8 +562,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 2
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -572,8 +584,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 3
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -593,8 +606,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 1
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -614,8 +628,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 3
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -635,8 +650,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 2
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -656,8 +672,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 5
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -677,8 +694,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
; SYMS: ]
@@ -691,7 +709,7 @@
; OBJ64-NEXT: NumberOfSections: 3
; OBJ64-NEXT: TimeStamp: None (0x0)
; OBJ64-NEXT: SymbolTableOffset: 0x170
-; OBJ64-NEXT: SymbolTableEntries: 0
+; OBJ64-NEXT: SymbolTableEntries: 45
; OBJ64-NEXT: OptionalHeaderSize: 0x0
; OBJ64-NEXT: Flags: 0x0
; OBJ64-NEXT: }
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll
index 9773bf63daeee..1a7adb8c346a3 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll
@@ -5,10 +5,11 @@
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --symbols %t.o | \
-; RUN: FileCheck --check-prefix=XCOFF32 %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=XCOFF,XCOFF32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=XCOFF,XCOFF64 %s
@La = external global i32, align 4
@@ -21,41 +22,43 @@ entry:
ret void
}
-; XCOFF32: Index: [[#IND:]]{{.*}}{{[[:space:]] *}}Name: .Lb
-; XCOFF32-NEXT: Value (RelocatableAddress): 0x0
-; XCOFF32-NEXT: Section: N_UNDEF
-; XCOFF32-NEXT: Type: 0x0
-; XCOFF32-NEXT: StorageClass: C_EXT (0x2)
-; XCOFF32-NEXT: NumberOfAuxEntries: 1
-; XCOFF32-NEXT: CSECT Auxiliary Entry {
-; XCOFF32-NEXT: Index: [[#IND+1]]
-; XCOFF32-NEXT: SectionLen: 0
-; XCOFF32-NEXT: ParameterHashIndex: 0x0
-; XCOFF32-NEXT: TypeChkSectNum: 0x0
-; XCOFF32-NEXT: SymbolAlignmentLog2: 0
-; XCOFF32-NEXT: SymbolType: XTY_ER (0x0)
-; XCOFF32-NEXT: StorageMappingClass: XMC_PR (0x0)
-; XCOFF32-NEXT: StabInfoIndex: 0x0
-; XCOFF32-NEXT: StabSectNum: 0x0
-; XCOFF32-NEXT: }
-; XCOFF32-NEXT: }
-; XCOFF32-NEXT: Symbol {
-; XCOFF32-NEXT: Index: [[#IND+2]]
-; XCOFF32-NEXT: Name: La
-; XCOFF32-NEXT: Value (RelocatableAddress): 0x0
-; XCOFF32-NEXT: Section: N_UNDEF
-; XCOFF32-NEXT: Type: 0x0
-; XCOFF32-NEXT: StorageClass: C_EXT (0x2)
-; XCOFF32-NEXT: NumberOfAuxEntries: 1
-; XCOFF32-NEXT: CSECT Auxiliary Entry {
-; XCOFF32-NEXT: Index: [[#IND+3]]
-; XCOFF32-NEXT: SectionLen: 0
-; XCOFF32-NEXT: ParameterHashIndex: 0x0
-; XCOFF32-NEXT: TypeChkSectNum: 0x0
-; XCOFF32-NEXT: SymbolAlignmentLog2: 0
-; XCOFF32-NEXT: SymbolType: XTY_ER (0x0)
-; XCOFF32-NEXT: StorageMappingClass: XMC_UA (0x4)
-; XCOFF32-NEXT: StabInfoIndex: 0x0
-; XCOFF32-NEXT: StabSectNum: 0x0
-; XCOFF32-NEXT: }
-; XCOFF32-NEXT: }
+; XCOFF: Index: [[#IND:]]{{.*}}{{[[:space:]] *}}Name: .Lb
+; XCOFF-NEXT: Value (RelocatableAddress): 0x0
+; XCOFF-NEXT: Section: N_UNDEF
+; XCOFF-NEXT: Type: 0x0
+; XCOFF-NEXT: StorageClass: C_EXT (0x2)
+; XCOFF-NEXT: NumberOfAuxEntries: 1
+; XCOFF-NEXT: CSECT Auxiliary Entry {
+; XCOFF-NEXT: Index: [[#IND+1]]
+; XCOFF-NEXT: SectionLen: 0
+; XCOFF-NEXT: ParameterHashIndex: 0x0
+; XCOFF-NEXT: TypeChkSectNum: 0x0
+; XCOFF-NEXT: SymbolAlignmentLog2: 0
+; XCOFF-NEXT: SymbolType: XTY_ER (0x0)
+; XCOFF-NEXT: StorageMappingClass: XMC_PR (0x0)
+; XCOFF32-NEXT: StabInfoIndex: 0x0
+; XCOFF32-NEXT: StabSectNum: 0x0
+; XCOFF64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
+; XCOFF-NEXT: }
+; XCOFF-NEXT: }
+; XCOFF-NEXT: Symbol {
+; XCOFF-NEXT: Index: [[#IND+2]]
+; XCOFF-NEXT: Name: La
+; XCOFF-NEXT: Value (RelocatableAddress): 0x0
+; XCOFF-NEXT: Section: N_UNDEF
+; XCOFF-NEXT: Type: 0x0
+; XCOFF-NEXT: StorageClass: C_EXT (0x2)
+; XCOFF-NEXT: NumberOfAuxEntries: 1
+; XCOFF-NEXT: CSECT Auxiliary Entry {
+; XCOFF-NEXT: Index: [[#IND+3]]
+; XCOFF-NEXT: SectionLen: 0
+; XCOFF-NEXT: ParameterHashIndex: 0x0
+; XCOFF-NEXT: TypeChkSectNum: 0x0
+; XCOFF-NEXT: SymbolAlignmentLog2: 0
+; XCOFF-NEXT: SymbolType: XTY_ER (0x0)
+; XCOFF-NEXT: StorageMappingClass: XMC_UA (0x4)
+; XCOFF32-NEXT: StabInfoIndex: 0x0
+; XCOFF32-NEXT: StabSectNum: 0x0
+; XCOFF64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
+; XCOFF-NEXT: }
+; XCOFF-NEXT: }
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll
index 78490fe598a05..2f1289f758a4b 100644
--- 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-lcomm.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll
index fd3a682e9f7ca..31fdea9ad13dd 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll
@@ -3,10 +3,13 @@
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
; RUN: llvm-readobj --section-headers --file-header %t.o | \
-; RUN: FileCheck --check-prefix=OBJ %s
-; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s
+; RUN: FileCheck --check-prefixes=OBJ,OBJ32 %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --section-headers --file-header %t64.o | \
+; RUN: FileCheck --check-prefixes=OBJ,OBJ64 %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYMS,SYMS64 %s
@a = internal global i32 0, align 4
@b = internal global i64 0, align 8
@@ -16,39 +19,36 @@
; CHECK-NEXT: .lcomm b,8,b[BS],3
; CHECK-NEXT: .lcomm c,2,c[BS],1
-; OBJ: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o
-; OBJ-NEXT: Format: aixcoff-rs6000
-; OBJ-NEXT: Arch: powerpc
-; OBJ-NEXT: AddressSize: 32bit
-; OBJ-NEXT: FileHeader {
-; OBJ-NEXT: Magic: 0x1DF
-; OBJ-NEXT: NumberOfSections: 2
-; OBJ-NEXT: TimeStamp:
-; OBJ-NEXT: SymbolTableOffset: 0x64
-; OBJ-NEXT: SymbolTableEntries: 9
-; OBJ-NEXT: OptionalHeaderSize: 0x0
-; OBJ-NEXT: Flags: 0x0
-; OBJ-NEXT: }
-; OBJ-NEXT: Sections [
-; OBJ: Section {{[{][[:space:]] *}}Index: 2
-; OBJ-NEXT: Name: .bss
-; OBJ-NEXT: PhysicalAddress: 0x0
-; OBJ-NEXT: VirtualAddress: 0x0
-; OBJ-NEXT: Size: 0x14
-; OBJ-NEXT: RawDataOffset: 0x0
-; OBJ-NEXT: RelocationPointer: 0x0
-; OBJ-NEXT: LineNumberPointer: 0x0
-; OBJ-NEXT: NumberOfRelocations: 0
-; OBJ-NEXT: NumberOfLineNumbers: 0
-; OBJ-NEXT: Type: STYP_BSS (0x80)
+; OBJ: Arch: powerpc
+; OBJ32-NEXT: AddressSize: 32bit
+; OBJ64-NEXT: AddressSize: 64bit
+; OBJ-NEXT: FileHeader {
+; OBJ32-NEXT: Magic: 0x1DF
+; OBJ64-NEXT: Magic: 0x1F7
+; OBJ-NEXT: NumberOfSections: 2
+; OBJ-NEXT: TimeStamp:
+; OBJ32-NEXT: SymbolTableOffset: 0x64
+; OBJ64-NEXT: SymbolTableOffset: 0xA8
+; OBJ-NEXT: SymbolTableEntries: 9
+; OBJ-NEXT: OptionalHeaderSize: 0x0
+; OBJ-NEXT: Flags: 0x0
; OBJ-NEXT: }
-; OBJ-NEXT: ]
+; OBJ-NEXT: Sections [
+; OBJ: Section {{[{][[:space:]] *}}Index: 2
+; OBJ-NEXT: Name: .bss
+; OBJ-NEXT: PhysicalAddress: 0x0
+; OBJ-NEXT: VirtualAddress: 0x0
+; OBJ-NEXT: Size: 0x14
+; OBJ-NEXT: RawDataOffset: 0x0
+; OBJ-NEXT: RelocationPointer: 0x0
+; OBJ-NEXT: LineNumberPointer: 0x0
+; OBJ-NEXT: NumberOfRelocations: 0
+; OBJ-NEXT: NumberOfLineNumbers: 0
+; OBJ-NEXT: Type: STYP_BSS (0x80)
+; OBJ-NEXT: }
+; OBJ-NEXT: ]
-; SYMS: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o
-; SYMS-NEXT: Format: aixcoff-rs6000
-; SYMS-NEXT: Arch: powerpc
-; SYMS-NEXT: AddressSize: 32bit
-; SYMS-NEXT: Symbols [
+; SYMS: Symbols [
; SYMS: Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
; SYMS-NEXT: Value (RelocatableAddress): 0x0
; SYMS-NEXT: Section: .bss
@@ -63,8 +63,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 2
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
; SYMS-NEXT: Symbol {
@@ -83,8 +84,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 3
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
; SYMS-NEXT: Symbol {
@@ -103,8 +105,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 1
; SYMS-NEXT: SymbolType: XTY_CM (0x3)
; SYMS-NEXT: StorageMappingClass: XMC_BS (0x9)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
; SYMS-NEXT: ]
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll
index 4755ca18d8aa3..dce12e9c4e7ab 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll
@@ -3,10 +3,13 @@
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \
; RUN: FileCheck --check-prefixes=CHECK,ASM64 %s
-; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj -r --expand-relocs --syms %t.o | FileCheck --check-prefixes=RELOC,SYM %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false \
+; RUN: -filetype=obj -o %t.o < %s
+; RUN: llvm-readobj -r --expand-relocs --syms %t.o | FileCheck --check-prefixes=RELOC,SYM,RELOC32,SYM32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj -r --expand-relocs --syms %t64.o | FileCheck --check-prefixes=RELOC,SYM,RELOC64,SYM64 %s
@common = common global i32 0, align 4
@pointer = global i32* @common, align 4
@@ -30,7 +33,8 @@
; RELOC-NEXT: Symbol: common ([[#COM_INDX:]])
; RELOC-NEXT: IsSigned: No
; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
; RELOC-NEXT: Type: R_POS (0x0)
; RELOC-NEXT: }
; RELOC-NEXT: }
@@ -44,14 +48,17 @@
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#INDX+1]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -70,14 +77,16 @@
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#COM_INDX]]
; SYM-NEXT: Name: common
-; SYM-NEXT: Value (RelocatableAddress): 0x4
+; SYM32-NEXT: Value (RelocatableAddress): 0x4
+; SYM64-NEXT: Value (RelocatableAddress): 0x8
; SYM-NEXT: Section: .bss
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_EXT (0x2)
@@ -90,7 +99,8 @@
; SYM-NEXT: SymbolAlignmentLog2: 2
; SYM-NEXT: SymbolType: XTY_CM (0x3)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll
index 0f2c0ed2beec3..4922c3eb9cc87 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll
@@ -3,6 +3,11 @@
; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck --check-prefixes=RELOC %s
; RUN: llvm-objdump -D -r --symbol-description %t.o | FileCheck --check-prefix=DIS %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
+; RUN: -filetype=obj -code-model=large -o %t64.o < %s
+; RUN: llvm-readobj --relocs --expand-relocs %t64.o | FileCheck --check-prefixes=RELOC64 %s
+; RUN: llvm-objdump -D -r --symbol-description %t64.o | FileCheck --check-prefix=DIS64 %s
+
@a = global i32 2, align 4
@b = global i32 10, align 4
@c = global i32 11, align 4
@@ -88,3 +93,76 @@ entry:
; DIS-NEXT: 24: 80 a5 00 00 lwz 5, 0(5)
; DIS-NEXT: 28: 7c 63 2a 14 add 3, 3, 5
; DIS-NEXT: 2c: 4e 80 00 20 blr
+
+; RELOC64: Section (index: {{[0-9]+}}) .text {
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0x2
+; RELOC64-NEXT: Symbol: a ([[#INDX:]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCU (0x30)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0x6
+; RELOC64-NEXT: Symbol: b ([[#INDX+2]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCU (0x30)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0xA
+; RELOC64-NEXT: Symbol: c ([[#INDX+4]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCU (0x30)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0xE
+; RELOC64-NEXT: Symbol: a ([[#INDX]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCL (0x31)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0x12
+; RELOC64-NEXT: Symbol: b ([[#INDX+2]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCL (0x31)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: Relocation {
+; RELOC64-NEXT: Virtual Address: 0x16
+; RELOC64-NEXT: Symbol: c ([[#INDX+4]])
+; RELOC64-NEXT: IsSigned: No
+; RELOC64-NEXT: FixupBitValue: 0
+; RELOC64-NEXT: Length: 16
+; RELOC64-NEXT: Type: R_TOCL (0x31)
+; RELOC64-NEXT: }
+; RELOC64-NEXT: }
+
+; DIS64: Disassembly of section .text:
+; DIS64-EMPTY:
+; DIS64-NEXT: 0000000000000000 (idx: 3) .foo:
+; DIS64-NEXT: 0: 3c 62 00 00 addis 3, 2, 0
+; DIS64-NEXT: 0000000000000002: R_TOCU (idx: [[#INDX:]]) a[TE]
+; DIS64-NEXT: 4: 3c 82 00 00 addis 4, 2, 0
+; DIS64-NEXT: 0000000000000006: R_TOCU (idx: [[#INDX+2]]) b[TE]
+; DIS64-NEXT: 8: 3c a2 00 00 addis 5, 2, 0
+; DIS64-NEXT: 000000000000000a: R_TOCU (idx: [[#INDX+4]]) c[TE]
+; DIS64-NEXT: c: e8 63 00 00 ld 3, 0(3)
+; DIS64-NEXT: 000000000000000e: R_TOCL (idx: [[#INDX]]) a[TE]
+; DIS64-NEXT: 10: e8 84 00 08 ld 4, 8(4)
+; DIS64-NEXT: 0000000000000012: R_TOCL (idx: [[#INDX+2]]) b[TE]
+; DIS64-NEXT: 14: e8 a5 00 10 ld 5, 16(5)
+; DIS64-NEXT: 0000000000000016: R_TOCL (idx: [[#INDX+4]]) c[TE]
+; DIS64-NEXT: 18: 80 63 00 00 lwz 3, 0(3)
+; DIS64-NEXT: 1c: 80 84 00 00 lwz 4, 0(4)
+; DIS64-NEXT: 20: 80 a5 00 00 lwz 5, 0(5)
+; DIS64-NEXT: 24: 7c 63 22 14 add 3, 3, 4
+; DIS64-NEXT: 28: 7c 63 2a 14 add 3, 3, 5
+; DIS64-NEXT: 2c: 4e 80 00 20 blr
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
index 7cf20b5ac7052..8bbf9174ef60a 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
@@ -1,13 +1,18 @@
; 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 --relocs --expand-relocs %t.o | FileCheck --check-prefix=RELOC %s
-; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYM %s
+; RUN: llvm-readobj --section-headers --file-header %t.o | FileCheck --check-prefixes=OBJ,OBJ32 %s
+; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck --check-prefixes=RELOC,RELOC32 %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYM,SYM32 %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-prefixes=OBJ,OBJ64 %s
+; RUN: llvm-readobj --relocs --expand-relocs %t64.o | FileCheck --check-prefixes=RELOC,RELOC64 %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYM,SYM64 %s
+; RUN: llvm-objdump -D %t64.o | FileCheck --check-prefix=DIS64 %s
+; RUN: llvm-objdump -r %t64.o | FileCheck --check-prefix=DIS_REL64 %s
@globalA = global i32 1, align 4
@globalB = global i32 2, align 4
@@ -26,19 +31,17 @@ entry:
declare i32 @bar(i32)
-; OBJ: File: {{.*}}aix-xcoff-reloc.ll.tmp.o
-; OBJ-NEXT: Format: aixcoff-rs6000
-; OBJ-NEXT: Arch: powerpc
-; OBJ-NEXT: AddressSize: 32bit
-; OBJ-NEXT: FileHeader {
-; OBJ-NEXT: Magic: 0x1DF
-; OBJ-NEXT: NumberOfSections: 2
-; OBJ-NEXT: TimeStamp: None (0x0)
-; OBJ-NEXT: SymbolTableOffset: 0x13C
-; OBJ-NEXT: SymbolTableEntries: 27
-; OBJ-NEXT: OptionalHeaderSize: 0x0
-; OBJ-NEXT: Flags: 0x0
-; OBJ-NEXT: }
+; OBJ: FileHeader {
+; OBJ32-NEXT: Magic: 0x1DF
+; OBJ64-NEXT: Magic: 0x1F7
+; OBJ-NEXT: NumberOfSections: 2
+; OBJ-NEXT: TimeStamp: None (0x0)
+; OBJ32-NEXT: SymbolTableOffset: 0x13C
+; OBJ64-NEXT: SymbolTableOffset: 0x1B8
+; OBJ-NEXT: SymbolTableEntries: 27
+; OBJ-NEXT: OptionalHeaderSize: 0x0
+; OBJ-NEXT: Flags: 0x0
+; OBJ-NEXT: }
; OBJ-NEXT: Sections [
; OBJ-NEXT: Section {
; OBJ-NEXT: Index: 1
@@ -46,8 +49,10 @@ declare i32 @bar(i32)
; OBJ-NEXT: PhysicalAddress: 0x0
; OBJ-NEXT: VirtualAddress: 0x0
; OBJ-NEXT: Size: 0x40
-; OBJ-NEXT: RawDataOffset: 0x64
-; OBJ-NEXT: RelocationPointer: 0xEC
+; OBJ32-NEXT: RawDataOffset: 0x64
+; OBJ32-NEXT: RelocationPointer: 0xEC
+; OBJ64-NEXT: RawDataOffset: 0xA8
+; OBJ64-NEXT: RelocationPointer: 0x148
; OBJ-NEXT: LineNumberPointer: 0x0
; OBJ-NEXT: NumberOfRelocations: 3
; OBJ-NEXT: NumberOfLineNumbers: 0
@@ -58,9 +63,12 @@ declare i32 @bar(i32)
; OBJ-NEXT: Name: .data
; OBJ-NEXT: PhysicalAddress: 0x40
; OBJ-NEXT: VirtualAddress: 0x40
-; OBJ-NEXT: Size: 0x48
-; OBJ-NEXT: RawDataOffset: 0xA4
-; OBJ-NEXT: RelocationPointer: 0x10A
+; OBJ32-NEXT: Size: 0x48
+; OBJ32-NEXT: RawDataOffset: 0xA4
+; OBJ32-NEXT: RelocationPointer: 0x10A
+; OBJ64-NEXT: Size: 0x60
+; OBJ64-NEXT: RawDataOffset: 0xE8
+; OBJ64-NEXT: RelocationPointer: 0x172
; OBJ-NEXT: LineNumberPointer: 0x0
; OBJ-NEXT: NumberOfRelocations: 5
; OBJ-NEXT: NumberOfLineNumbers: 0
@@ -68,80 +76,84 @@ declare i32 @bar(i32)
; OBJ-NEXT: }
; OBJ-NEXT: ]
-
-; RELOC: File: {{.*}}aix-xcoff-reloc.ll.tmp.o
-; RELOC-NEXT: Format: aixcoff-rs6000
-; RELOC-NEXT: Arch: powerpc
-; RELOC-NEXT: AddressSize: 32bit
-; RELOC-NEXT: Relocations [
+; RELOC: Relocations [
; RELOC-NEXT: Section (index: 1) .text {
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x10
-; RELOC-NEXT: Symbol: .bar (1)
-; RELOC-NEXT: IsSigned: Yes
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 26
-; RELOC-NEXT: Type: R_RBR (0x1A)
-; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x1A
-; RELOC-NEXT: Symbol: globalA (23)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 16
-; RELOC-NEXT: Type: R_TOC (0x3)
+; RELOC-NEXT: Relocation {
+; RELOC-NEXT: Virtual Address: 0x10
+; RELOC-NEXT: Symbol: .bar (1)
+; RELOC-NEXT: IsSigned: Yes
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC-NEXT: Length: 26
+; RELOC-NEXT: Type: R_RBR (0x1A)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC-NEXT: Virtual Address: 0x1A
+; RELOC-NEXT: Symbol: globalA (23)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC-NEXT: Length: 16
+; RELOC-NEXT: Type: R_TOC (0x3)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC-NEXT: Virtual Address: 0x1E
+; RELOC-NEXT: Symbol: globalB (25)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC-NEXT: Length: 16
+; RELOC-NEXT: Type: R_TOC (0x3)
+; RELOC-NEXT: }
; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x1E
-; RELOC-NEXT: Symbol: globalB (25)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 16
-; RELOC-NEXT: Type: R_TOC (0x3)
+; RELOC-NEXT: Section (index: 2) .data {
+; RELOC-NEXT: Relocation {
+; RELOC-NEXT: Virtual Address: 0x70
+; RELOC-NEXT: Symbol: arr (15)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
+; RELOC-NEXT: Type: R_POS (0x0)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC32-NEXT: Virtual Address: 0x74
+; RELOC64-NEXT: Virtual Address: 0x78
+; RELOC-NEXT: Symbol: .foo (7)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
+; RELOC-NEXT: Type: R_POS (0x0)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC32-NEXT: Virtual Address: 0x78
+; RELOC64-NEXT: Virtual Address: 0x80
+; RELOC-NEXT: Symbol: TOC (21)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
+; RELOC-NEXT: Type: R_POS (0x0)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC32-NEXT: Virtual Address: 0x80
+; RELOC64-NEXT: Virtual Address: 0x90
+; RELOC-NEXT: Symbol: globalA (11)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
+; RELOC-NEXT: Type: R_POS (0x0)
+; RELOC-NEXT: }
+; RELOC-NEXT: Relocation {
+; RELOC32-NEXT: Virtual Address: 0x84
+; RELOC64-NEXT: Virtual Address: 0x98
+; RELOC-NEXT: Symbol: globalB (13)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
+; RELOC32-NEXT: Length: 32
+; RELOC64-NEXT: Length: 64
+; RELOC-NEXT: Type: R_POS (0x0)
+; RELOC-NEXT: }
; RELOC-NEXT: }
-; RELOC-NEXT: }
-; RELOC-NEXT: Section (index: 2) .data {
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x70
-; RELOC-NEXT: Symbol: arr (15)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
-; RELOC-NEXT: Type: R_POS (0x0)
-; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x74
-; RELOC-NEXT: Symbol: .foo (7)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
-; RELOC-NEXT: Type: R_POS (0x0)
-; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x78
-; RELOC-NEXT: Symbol: TOC (21)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
-; RELOC-NEXT: Type: R_POS (0x0)
-; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x80
-; RELOC-NEXT: Symbol: globalA (11)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
-; RELOC-NEXT: Type: R_POS (0x0)
-; RELOC-NEXT: }
-; RELOC-NEXT: Relocation {
-; RELOC-NEXT: Virtual Address: 0x84
-; RELOC-NEXT: Symbol: globalB (13)
-; RELOC-NEXT: IsSigned: No
-; RELOC-NEXT: FixupBitValue: 0
-; RELOC-NEXT: Length: 32
-; RELOC-NEXT: Type: R_POS (0x0)
-; RELOC-NEXT: }
-; RELOC-NEXT: }
; RELOC-NEXT: ]
; SYM: Symbols [
@@ -171,8 +183,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -191,8 +204,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -211,8 +225,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 4
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -231,8 +246,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -245,14 +261,17 @@ declare i32 @bar(i32)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#INDX+9]]
-; SYM-NEXT: SectionLen: 52
+; SYM32-NEXT: SectionLen: 52
+; SYM64-NEXT: SectionLen: 56
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -271,8 +290,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -291,8 +311,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -311,8 +332,9 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -331,34 +353,40 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_LD (0x2)
; SYM-NEXT: StorageMappingClass: XMC_RW (0x5)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#INDX+18]]
; SYM-NEXT: Name: foo
-; SYM-NEXT: Value (RelocatableAddress): 0x74
+; SYM32-NEXT: Value (RelocatableAddress): 0x74
+; SYM64-NEXT: Value (RelocatableAddress): 0x78
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_EXT (0x2)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#INDX+19]]
-; SYM-NEXT: SectionLen: 12
+; SYM32-NEXT: SectionLen: 12
+; SYM64-NEXT: SectionLen: 24
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#INDX+20]]
; SYM-NEXT: Name: TOC
-; SYM-NEXT: Value (RelocatableAddress): 0x80
+; SYM32-NEXT: Value (RelocatableAddress): 0x80
+; SYM64-NEXT: Value (RelocatableAddress): 0x90
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
@@ -371,48 +399,57 @@ declare i32 @bar(i32)
; SYM-NEXT: SymbolAlignmentLog2: 2
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#INDX+22]]
; SYM-NEXT: Name: globalA
-; SYM-NEXT: Value (RelocatableAddress): 0x80
+; SYM32-NEXT: Value (RelocatableAddress): 0x80
+; SYM64-NEXT: Value (RelocatableAddress): 0x90
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#INDX+23]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#INDX+24]]
; SYM-NEXT: Name: globalB
-; SYM-NEXT: Value (RelocatableAddress): 0x84
+; SYM32-NEXT: Value (RelocatableAddress): 0x84
+; SYM64-NEXT: Value (RelocatableAddress): 0x98
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#INDX+25]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: ]
@@ -470,3 +507,58 @@ declare i32 @bar(i32)
; DIS_REL-NEXT: 00000038 R_POS TOC
; DIS_REL-NEXT: 00000040 R_POS globalA
; DIS_REL-NEXT: 00000044 R_POS globalB
+
+; DIS64: Disassembly of section .text:
+; DIS64: 0000000000000000 <.foo>:
+; DIS64-NEXT: 0: 7c 08 02 a6 mflr 0
+; DIS64-NEXT: 4: f8 01 00 10 std 0, 16(1)
+; DIS64-NEXT: 8: f8 21 ff 91 stdu 1, -112(1)
+; DIS64-NEXT: c: 38 60 00 01 li 3, 1
+; DIS64-NEXT: 10: 4b ff ff f1 bl 0x0 <.foo>
+; DIS64-NEXT: 14: 60 00 00 00 nop
+; DIS64-NEXT: 18: e8 82 00 00 ld 4, 0(2)
+; DIS64-NEXT: 1c: e8 a2 00 08 ld 5, 8(2)
+; DIS64-NEXT: 20: 80 84 00 00 lwz 4, 0(4)
+; DIS64-NEXT: 24: 80 a5 00 00 lwz 5, 0(5)
+; DIS64-NEXT: 28: 7c 63 22 14 add 3, 3, 4
+; DIS64-NEXT: 2c: 7c 63 2a 14 add 3, 3, 5
+; DIS64-NEXT: 30: 38 21 00 70 addi 1, 1, 112
+; DIS64-NEXT: 34: e8 01 00 10 ld 0, 16(1)
+; DIS64-NEXT: 38: 7c 08 03 a6 mtlr 0
+; DIS64-NEXT: 3c: 4e 80 00 20 blr
+
+; DIS64: Disassembly of section .data:
+; DIS64: 0000000000000040 <globalA>:
+; DIS64-NEXT: 40: 00 00 00 01 <unknown>
+; DIS64: 0000000000000044 <globalB>:
+; DIS64-NEXT: 44: 00 00 00 02 <unknown>
+; DIS64: 0000000000000048 <arr>:
+; DIS64-NEXT: 48: 00 00 00 03 <unknown>
+; DIS64-NEXT: ...
+; DIS64: 0000000000000070 <p>:
+; DIS64-NEXT: 70: 00 00 00 00 <unknown>
+; DIS64-NEXT: 74: 00 00 00 58 <unknown>
+; DIS64: 0000000000000078 <foo>:
+; DIS64-NEXT: ...
+; DIS64-NEXT: 84: 00 00 00 90 <unknown>
+; DIS64-NEXT: ...
+; DIS64: 0000000000000090 <globalA>:
+; DIS64-NEXT: 90: 00 00 00 00 <unknown>
+; DIS64-NEXT: 94: 00 00 00 40 <unknown>
+; DIS64: 0000000000000098 <globalB>:
+; DIS64-NEXT: 98: 00 00 00 00 <unknown>
+; DIS64-NEXT: 9c: 00 00 00 44 <unknown>
+
+; DIS_REL64: RELOCATION RECORDS FOR [.text]:
+; DIS_REL64-NEXT: OFFSET TYPE VALUE
+; DIS_REL64-NEXT: 0000000000000010 R_RBR .bar
+; DIS_REL64-NEXT: 000000000000001a R_TOC globalA
+; DIS_REL64-NEXT: 000000000000001e R_TOC globalB
+
+; DIS_REL64: RELOCATION RECORDS FOR [.data]:
+; DIS_REL64-NEXT: OFFSET TYPE VALUE
+; DIS_REL64-NEXT: 0000000000000030 R_POS arr
+; DIS_REL64-NEXT: 0000000000000038 R_POS .foo
+; DIS_REL64-NEXT: 0000000000000040 R_POS TOC
+; DIS_REL64-NEXT: 0000000000000050 R_POS globalA
+; DIS_REL64-NEXT: 0000000000000058 R_POS globalB
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
index 6fa1d220e11fc..01ca2882c1c36 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
@@ -3,13 +3,18 @@
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \
; RUN: FileCheck --check-prefixes=CHECK,CHECK64 %s
-; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -data-sections=false \
+; RUN: -filetype=obj -o %t.o < %s
; RUN: llvm-readobj --section-headers --file-header %t.o | \
-; RUN: FileCheck --check-prefix=OBJ %s
-; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s
+; RUN: FileCheck --check-prefixes=OBJ,OBJ32 %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS32 %s
; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false \
+; RUN: -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --section-headers --file-header %t64.o | \
+; RUN: FileCheck --check-prefixes=OBJ,OBJ64 %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYMS,SYMS64 %s
@const_ivar = constant i32 35, align 4
@const_llvar = constant i64 36, align 8
@@ -70,16 +75,13 @@
; CHECK32-NEXT: .vbyte 4, 0
; CHECK64-NEXT: .vbyte 8, 0x4010000000000000
-
-; OBJ: File: {{.*}}aix-xcoff-rodata.ll.tmp.o
-; OBJ-NEXT: Format: aixcoff-rs6000
-; OBJ-NEXT: Arch: powerpc
-; OBJ-NEXT: AddressSize: 32bit
-; OBJ-NEXT: FileHeader {
-; OBJ-NEXT: Magic: 0x1DF
+; OBJ: FileHeader {
+; OBJ32-NEXT: Magic: 0x1DF
+; OBJ64-NEXT: Magic: 0x1F7
; OBJ-NEXT: NumberOfSections: 1
; OBJ-NEXT: TimeStamp: None (0x0)
-; OBJ-NEXT: SymbolTableOffset: 0x8C
+; OBJ32-NEXT: SymbolTableOffset: 0x8C
+; OBJ64-NEXT: SymbolTableOffset: 0xB0
; OBJ-NEXT: SymbolTableEntries: 21
; OBJ-NEXT: OptionalHeaderSize: 0x0
; OBJ-NEXT: Flags: 0x0
@@ -91,8 +93,10 @@
; OBJ-NEXT: Name: .text
; OBJ-NEXT: PhysicalAddress: 0x0
; OBJ-NEXT: VirtualAddress: 0x0
-; OBJ-NEXT: Size: 0x50
-; OBJ-NEXT: RawDataOffset: 0x3C
+; OBJ32-NEXT: Size: 0x50
+; OBJ32-NEXT: RawDataOffset: 0x3C
+; OBJ64-NEXT: Size: 0x50
+; OBJ64-NEXT: RawDataOffset: 0x60
; OBJ-NEXT: RelocationPointer: 0x0
; OBJ-NEXT: LineNumberPointer: 0x0
; OBJ-NEXT: NumberOfRelocations: 0
@@ -101,11 +105,6 @@
; OBJ-NEXT: }
; OBJ-NEXT: ]
-
-; SYMS: File: {{.*}}aix-xcoff-rodata.ll.tmp.o
-; SYMS-NEXT: Format: aixcoff-rs6000
-; SYMS-NEXT: Arch: powerpc
-; SYMS-NEXT: AddressSize: 32bit
; SYMS: Symbols [
; SYMS: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .rodata
; SYMS-NEXT: Value (RelocatableAddress): 0x0
@@ -121,8 +120,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 5
; SYMS-NEXT: SymbolType: XTY_SD (0x1)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -142,8 +142,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -163,8 +164,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -184,8 +186,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -205,8 +208,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -226,8 +230,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -247,8 +252,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -268,8 +274,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
@@ -289,8 +296,9 @@
; SYMS-NEXT: SymbolAlignmentLog2: 0
; SYMS-NEXT: SymbolType: XTY_LD (0x2)
; SYMS-NEXT: StorageMappingClass: XMC_RO (0x1)
-; SYMS-NEXT: StabInfoIndex: 0x0
-; SYMS-NEXT: StabSectNum: 0x0
+; SYMS32-NEXT: StabInfoIndex: 0x0
+; SYMS32-NEXT: StabSectNum: 0x0
+; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYMS-NEXT: }
; SYMS-NEXT: }
; SYMS: ]
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll
index dac811a0014e1..4ed0e3970e0d9 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll
@@ -1,15 +1,17 @@
; This file tests TOC entry generation and undefined symbol generation.
-; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
-; RUN: -xcoff-traceback-table=false < %s | FileCheck --check-prefixes CHECK,CHECK32 %s
-; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
-; RUN: -xcoff-traceback-table=false < %s 2>&1 | FileCheck --check-prefixes CHECK,CHECK64 %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
+; RUN: -xcoff-traceback-table=false < %s | FileCheck --check-prefixes CHECK,CHECK32 %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
+; RUN: -xcoff-traceback-table=false < %s 2>&1 | FileCheck --check-prefixes CHECK,CHECK64 %s
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \
; RUN: --xcoff-traceback-table=false -filetype=obj -o %t.o < %s
-; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYM %s
+; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYM,SYM32 %s
-;; FIXME: currently only fileHeader and sectionHeaders are supported in XCOFF64.
+; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \
+; RUN: --xcoff-traceback-table=false -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --syms %t64.o | FileCheck --check-prefixes=SYM,SYM64 %s
@a = external global i32, align 4
@b = external global i64, align 8
@@ -77,7 +79,6 @@ define void @foobar() {
; Test undefined symbol generation.
-; SYM: File: {{.*}}aix-xcoff-toc.ll.tmp.o
; SYM: Symbol {{[{][[:space:]] *}}Index: [[#UNDEF_INDX:]]{{[[:space:]] *}}Name: a
; SYM-NEXT: Value (RelocatableAddress): 0x0
; SYM-NEXT: Section: N_UNDEF
@@ -92,8 +93,9 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_UA (0x4)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -112,8 +114,9 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_UA (0x4)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -132,8 +135,9 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_UA (0x4)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -152,8 +156,9 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_PR (0x0)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
@@ -172,15 +177,17 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolType: XTY_ER (0x0)
; SYM-NEXT: StorageMappingClass: XMC_DS (0xA)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; Test TOC entry symbol generation.
; SYM: Symbol {{[{][[:space:]] *}}Index: [[#TOC_INDX:]]{{[[:space:]] *}}Name: TOC
-; SYM-NEXT: Value (RelocatableAddress): 0xA8
+; SYM32-NEXT: Value (RelocatableAddress): 0xA8
+; SYM64-NEXT: Value (RelocatableAddress): 0xC0
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
@@ -193,167 +200,200 @@ define void @foobar() {
; SYM-NEXT: SymbolAlignmentLog2: 2
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC0 (0xF)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+2]]
; SYM-NEXT: Name: a
-; SYM-NEXT: Value (RelocatableAddress): 0xA8
+; SYM32-NEXT: Value (RelocatableAddress): 0xA8
+; SYM64-NEXT: Value (RelocatableAddress): 0xC0
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+3]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+4]]
; SYM-NEXT: Name: b
-; SYM-NEXT: Value (RelocatableAddress): 0xAC
+; SYM32-NEXT: Value (RelocatableAddress): 0xAC
+; SYM64-NEXT: Value (RelocatableAddress): 0xC8
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+5]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+6]]
; SYM-NEXT: Name: c
-; SYM-NEXT: Value (RelocatableAddress): 0xB0
+; SYM32-NEXT: Value (RelocatableAddress): 0xB0
+; SYM64-NEXT: Value (RelocatableAddress): 0xD0
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+7]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+8]]
; SYM-NEXT: Name: globa
-; SYM-NEXT: Value (RelocatableAddress): 0xB4
+; SYM32-NEXT: Value (RelocatableAddress): 0xB4
+; SYM64-NEXT: Value (RelocatableAddress): 0xD8
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+9]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+10]]
; SYM-NEXT: Name: ptr
-; SYM-NEXT: Value (RelocatableAddress): 0xB8
+; SYM32-NEXT: Value (RelocatableAddress): 0xB8
+; SYM64-NEXT: Value (RelocatableAddress): 0xE0
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+11]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+12]]
; SYM-NEXT: Name: bar
-; SYM-NEXT: Value (RelocatableAddress): 0xBC
+; SYM32-NEXT: Value (RelocatableAddress): 0xBC
+; SYM64-NEXT: Value (RelocatableAddress): 0xE8
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+13]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+14]]
; SYM-NEXT: Name: foo
-; SYM-NEXT: Value (RelocatableAddress): 0xC0
+; SYM32-NEXT: Value (RelocatableAddress): 0xC0
+; SYM64-NEXT: Value (RelocatableAddress): 0xF0
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+15]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
; SYM-NEXT: Symbol {
; SYM-NEXT: Index: [[#TOC_INDX+16]]
; SYM-NEXT: Name: foobar
-; SYM-NEXT: Value (RelocatableAddress): 0xC4
+; SYM32-NEXT: Value (RelocatableAddress): 0xC4
+; SYM64-NEXT: Value (RelocatableAddress): 0xF8
; SYM-NEXT: Section: .data
; SYM-NEXT: Type: 0x0
; SYM-NEXT: StorageClass: C_HIDEXT (0x6B)
; SYM-NEXT: NumberOfAuxEntries: 1
; SYM-NEXT: CSECT Auxiliary Entry {
; SYM-NEXT: Index: [[#TOC_INDX+17]]
-; SYM-NEXT: SectionLen: 4
+; SYM32-NEXT: SectionLen: 4
+; SYM64-NEXT: SectionLen: 8
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
-; SYM-NEXT: SymbolAlignmentLog2: 2
+; SYM32-NEXT: SymbolAlignmentLog2: 2
+; SYM64-NEXT: SymbolAlignmentLog2: 3
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_TC (0x3)
-; SYM-NEXT: StabInfoIndex: 0x0
-; SYM-NEXT: StabSectNum: 0x0
+; SYM32-NEXT: StabInfoIndex: 0x0
+; SYM32-NEXT: StabSectNum: 0x0
+; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
; SYM-NEXT: }
; SYM-NEXT: }
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll
index f5584d324e3ea..2b9afd3655d14 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll
@@ -5,15 +5,13 @@
; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff \
; RUN: -filetype=obj -o %t.o < %s 2>&1 | \
-; RUN: FileCheck --check-prefix=XCOFF32 %s
-; XCOFF32: LLVM ERROR: Emitting non-zero visibilities is not supported yet.
+; RUN: FileCheck --check-prefix=XCOFF %s
; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -filetype=obj -o %t.o 2>&1 < %s 2>&1 | \
-; RUN: FileCheck --check-prefix=XCOFF64 %s
-; FIXME: This should check for the visibility error, but we actually fail before
-; that due to unimplemented relocations.
-; XCOFF64: LLVM ERROR: Unimplemented fixup kind.
+; RUN: FileCheck --check-prefix=XCOFF %s
+
+; XCOFF: LLVM ERROR: Emitting non-zero visibilities is not supported yet.
@b = global i32 0, align 4
@b_h = hidden global i32 0, align 4
diff --git a/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll b/llvm/test/CodeGen/PowerPC/basic-toc-data-def.ll
index 235b1c28aa5bb..b331416304a7e 100644
--- 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
index e4d717c035be4..6279b2a65f693 100644
--- 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 @@ define i32* @get() {
; 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" }
diff --git a/llvm/test/MC/PowerPC/ppc64-abs-reloc.s b/llvm/test/MC/PowerPC/ppc64-abs-reloc.s
index 8b0d0b4471783..d38e1f4b8dc13 100644
--- a/llvm/test/MC/PowerPC/ppc64-abs-reloc.s
+++ b/llvm/test/MC/PowerPC/ppc64-abs-reloc.s
@@ -1,6 +1,9 @@
# RUN: llvm-mc -triple powerpc64le-unknown-linux-gnu %s -filetype=obj -o - | \
# RUN: llvm-objdump -D -r - | FileCheck %s
- .text
+
+# RUN: llvm-mc -triple powerpc64-ibm-aix-xcoff %s -filetype=obj -o - | \
+# RUN: llvm-objdump -D -r - | FileCheck %s
+
test: # @test
add 5, 3, 4
extsw 3, 5
More information about the llvm-commits
mailing list