[llvm] dd582cd - [SystemZ][z/OS] Add split DWARF support for GOFF (#215337)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 10:11:54 PDT 2026
Author: Maryam Moghadas
Date: 2026-08-20T13:11:49-04:00
New Revision: dd582cdc124ea26866b6c0942a18d62de20e96b0
URL: https://github.com/llvm/llvm-project/commit/dd582cdc124ea26866b6c0942a18d62de20e96b0
DIFF: https://github.com/llvm/llvm-project/commit/dd582cdc124ea26866b6c0942a18d62de20e96b0.diff
LOG: [SystemZ][z/OS] Add split DWARF support for GOFF (#215337)
Adds split DWARF support to the GOFF object writer for z/OS.
When a .dwo file is requested, DWO sections go there and the rest stay
in the main object. Without one, everything stays in the single .o
as before.
Added:
llvm/test/DebugInfo/GOFF/fission-cu.ll
llvm/test/DebugInfo/GOFF/fission-sections.ll
Modified:
llvm/include/llvm/MC/MCGOFFObjectWriter.h
llvm/lib/MC/GOFFObjectWriter.cpp
llvm/lib/MC/MCAsmBackend.cpp
llvm/lib/MC/MCObjectFileInfo.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCGOFFObjectWriter.h b/llvm/include/llvm/MC/MCGOFFObjectWriter.h
index 8bffdd596d11d..491bc62d9f9e3 100644
--- a/llvm/include/llvm/MC/MCGOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCGOFFObjectWriter.h
@@ -80,6 +80,9 @@ class LLVM_ABI GOFFObjectWriter : public MCObjectWriter {
// The stream used to write the GOFF records.
raw_pwrite_stream &OS;
+ // The stream used to write the split DWARF file.
+ raw_pwrite_stream *DwoOS = nullptr;
+
// The RootSD section.
MCSectionGOFF *RootSD = nullptr;
@@ -89,6 +92,8 @@ class LLVM_ABI GOFFObjectWriter : public MCObjectWriter {
public:
GOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS);
+ GOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
+ raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS);
~GOFFObjectWriter() override;
void reset() override;
@@ -110,6 +115,10 @@ class LLVM_ABI GOFFObjectWriter : public MCObjectWriter {
LLVM_ABI std::unique_ptr<MCObjectWriter>
createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS);
+
+std::unique_ptr<MCObjectWriter>
+createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
+ raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS);
} // namespace llvm
#endif
diff --git a/llvm/lib/MC/GOFFObjectWriter.cpp b/llvm/lib/MC/GOFFObjectWriter.cpp
index ab497ac38b90e..4545aea35cba5 100644
--- a/llvm/lib/MC/GOFFObjectWriter.cpp
+++ b/llvm/lib/MC/GOFFObjectWriter.cpp
@@ -292,6 +292,16 @@ class GOFFWriter {
/// Saved relocation data collected in recordRelocations().
std::vector<GOFFRelocationEntry> &Relocations;
+public:
+ enum DwoMode {
+ AllSections,
+ NonDwoOnly,
+ DwoOnly,
+ };
+
+private:
+ const DwoMode Mode;
+
void writeHeader();
void writeSymbol(const GOFFSymbol &Symbol);
void writeText(const MCSectionGOFF *MC);
@@ -305,17 +315,40 @@ class GOFFWriter {
public:
GOFFWriter(raw_pwrite_stream &OS, MCAssembler &Asm, MCSectionGOFF *RootSD,
- std::vector<GOFFRelocationEntry> &Relocations);
+ std::vector<GOFFRelocationEntry> &Relocations, DwoMode Mode);
uint64_t writeObject();
};
} // namespace
GOFFWriter::GOFFWriter(raw_pwrite_stream &OS, MCAssembler &Asm,
MCSectionGOFF *RootSD,
- std::vector<GOFFRelocationEntry> &Relocations)
- : OS(OS), Asm(Asm), RootSD(RootSD), Relocations(Relocations) {}
+ std::vector<GOFFRelocationEntry> &Relocations,
+ DwoMode Mode)
+ : OS(OS), Asm(Asm), RootSD(RootSD), Relocations(Relocations), Mode(Mode) {}
+
+namespace {
+bool isDwoSection(const MCSection &Section) {
+ StringRef Name = Section.getName();
+ return (Name.ends_with(".dwo") && Name.starts_with(".debug_")) ||
+ (Name.ends_with("_DWO") && Name.starts_with("D_"));
+}
+
+bool isSectionToSkip(const MCSection &Section, GOFFWriter::DwoMode Mode) {
+ if (Mode == GOFFWriter::DwoOnly) {
+ if (!isDwoSection(Section))
+ return true;
+ } else if (Mode == GOFFWriter::NonDwoOnly) {
+ if (isDwoSection(Section))
+ return true;
+ }
+ return false;
+}
+} // namespace
void GOFFWriter::defineSectionSymbols(const MCSectionGOFF &Section) {
+ if (isSectionToSkip(Section, Mode))
+ return;
+
if (Section.isSD()) {
GOFFSymbol SD(Section.getExternalName(), Section.getOrdinal(),
Section.getSDAttributes());
@@ -396,14 +429,20 @@ void GOFFWriter::defineSymbols() {
continue;
auto &Symbol = static_cast<const MCSymbolGOFF &>(Sym);
if (!Symbol.isDefined()) {
- Symbol.setIndex(++Ordinal);
- defineExtern(Symbol);
- } else if (Symbol.isInEDSection()) {
- Symbol.setIndex(++Ordinal);
- defineLabel(Symbol);
+ if (Mode != DwoOnly) {
+ Symbol.setIndex(++Ordinal);
+ defineExtern(Symbol);
+ }
} else {
- // Symbol is in PR section, the symbol refers to the section.
- Symbol.setIndex(Symbol.getSection().getOrdinal());
+ if (isSectionToSkip(Symbol.getSection(), Mode))
+ continue;
+ if (Symbol.isInEDSection()) {
+ Symbol.setIndex(++Ordinal);
+ defineLabel(Symbol);
+ } else {
+ // Symbol is in PR section, the symbol refers to the section.
+ Symbol.setIndex(Symbol.getSection().getOrdinal());
+ }
}
}
}
@@ -672,7 +711,9 @@ uint64_t GOFFWriter::writeObject() {
for (const MCSection &Section : Asm)
writeText(static_cast<const MCSectionGOFF *>(&Section));
- writeRelocations();
+ // Do not write relocations into the dwo file.
+ if (Mode != GOFFWriter::DwoOnly)
+ writeRelocations();
writeEnd();
@@ -689,6 +730,11 @@ GOFFObjectWriter::GOFFObjectWriter(
std::unique_ptr<MCGOFFObjectTargetWriter> MOTW, raw_pwrite_stream &OS)
: TargetObjectWriter(std::move(MOTW)), OS(OS) {}
+GOFFObjectWriter::GOFFObjectWriter(
+ std::unique_ptr<MCGOFFObjectTargetWriter> MOTW, raw_pwrite_stream &OS,
+ raw_pwrite_stream &DwoOS)
+ : TargetObjectWriter(std::move(MOTW)), OS(OS), DwoOS(&DwoOS) {}
+
GOFFObjectWriter::~GOFFObjectWriter() = default;
void GOFFObjectWriter::reset() {
@@ -810,7 +856,13 @@ void GOFFObjectWriter::recordRelocation(const MCFragment &F,
}
uint64_t GOFFObjectWriter::writeObject() {
- uint64_t Size = GOFFWriter(OS, *Asm, RootSD, Relocations).writeObject();
+ uint64_t Size = 0;
+ if (DwoOS)
+ Size += GOFFWriter(*DwoOS, *Asm, RootSD, Relocations, GOFFWriter::DwoOnly)
+ .writeObject();
+ Size += GOFFWriter(OS, *Asm, RootSD, Relocations,
+ DwoOS ? GOFFWriter::NonDwoOnly : GOFFWriter::AllSections)
+ .writeObject();
return Size;
}
@@ -819,3 +871,9 @@ llvm::createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS) {
return std::make_unique<GOFFObjectWriter>(std::move(MOTW), OS);
}
+
+std::unique_ptr<MCObjectWriter>
+llvm::createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW,
+ raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS) {
+ return std::make_unique<GOFFObjectWriter>(std::move(MOTW), OS, DwoOS);
+}
diff --git a/llvm/lib/MC/MCAsmBackend.cpp b/llvm/lib/MC/MCAsmBackend.cpp
index d0856d25aee21..1ab76d8d54b2b 100644
--- a/llvm/lib/MC/MCAsmBackend.cpp
+++ b/llvm/lib/MC/MCAsmBackend.cpp
@@ -74,11 +74,14 @@ MCAsmBackend::createDwoObjectWriter(raw_pwrite_stream &OS,
return std::make_unique<ELFObjectWriter>(
cast<MCELFObjectTargetWriter>(std::move(TW)), OS, DwoOS,
Endian == llvm::endianness::little);
+ case Triple::GOFF:
+ return createGOFFObjectWriter(cast<MCGOFFObjectTargetWriter>(std::move(TW)),
+ OS, DwoOS);
case Triple::Wasm:
return createWasmDwoObjectWriter(
cast<MCWasmObjectTargetWriter>(std::move(TW)), OS, DwoOS);
default:
- report_fatal_error("dwo only supported with COFF, ELF, and Wasm");
+ report_fatal_error("dwo only supported with COFF, ELF, GOFF, and Wasm");
}
}
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index d41c8ca8a9815..65534186edbac 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -680,6 +680,23 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
InitDebugSection("D_APPLNMSP", ".apple_namespaces");
DwarfAccelTypesSection = InitDebugSection("D_APPLTYPS", ".apple_types");
DwarfAccelObjCSection = InitDebugSection("D_APPLOBJC", ".apple_objc");
+
+ // Fission Sections
+ DwarfInfoDWOSection = InitDebugSection("D_INFO_DWO", ".debug_info.dwo");
+ DwarfTypesDWOSection = InitDebugSection("D_TYPES_DWO", ".debug_types.dwo");
+ DwarfAbbrevDWOSection = InitDebugSection("D_ABREV_DWO", ".debug_abbrev.dwo");
+ DwarfStrDWOSection = InitDebugSection("D_STR_DWO", ".debug_str.dwo");
+ DwarfLineDWOSection = InitDebugSection("D_LINE_DWO", ".debug_line.dwo");
+ DwarfLocDWOSection = InitDebugSection("D_LOC_DWO", ".debug_loc.dwo");
+ DwarfStrOffDWOSection =
+ InitDebugSection("D_STROFFS_DWO", ".debug_str_offsets.dwo");
+ DwarfRnglistsDWOSection =
+ InitDebugSection("D_RNGLISTS_DWO", ".debug_rnglists.dwo");
+ DwarfMacinfoDWOSection =
+ InitDebugSection("D_MACINFO_DWO", ".debug_macinfo.dwo");
+ DwarfMacroDWOSection = InitDebugSection("D_MACRO_DWO", ".debug_macro.dwo");
+ DwarfLoclistsDWOSection =
+ InitDebugSection("D_LOCLISTS_DWO", ".debug_loclists.dwo");
}
void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
diff --git a/llvm/test/DebugInfo/GOFF/fission-cu.ll b/llvm/test/DebugInfo/GOFF/fission-cu.ll
new file mode 100644
index 0000000000000..908880425dff9
--- /dev/null
+++ b/llvm/test/DebugInfo/GOFF/fission-cu.ll
@@ -0,0 +1,132 @@
+; RUN: llc -filetype=obj -mtriple=s390x-ibm-zos -split-dwarf-file=foo.dwo \
+; RUN: %s -o %t
+; RUN: od -Ax -tx1 -v %t | FileCheck --ignore-case %s
+
+; REQUIRES: systemz-registered-target
+
+ at a = common global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.c", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, isOptimized: false, runtimeVersion: 0, splitDebugFilename: "foo.dwo", emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+
+; D_ABREV (.debug_abbrev), EsdId=8
+; CHECK: 000320 03 00 00 01 00 00 00 08 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 000330 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00
+; CHECK-NEXT: 000340 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 000350 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000360 00 80 03 00 00 00 00 07 c4 6d c1 c2 d9 c5 e5 00
+
+; D_INFO (.debug_info), EsdId=9
+; CHECK-NEXT: 000370 03 00 00 01 00 00 00 09 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 000380 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00
+; CHECK-NEXT: 000390 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 0003a0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 0003b0 00 80 03 00 00 00 00 06 c4 6d c9 d5 c6 d6 00 00
+
+; D_STR (.debug_str), EsdId=0xa
+; CHECK-NEXT: 0003c0 03 00 00 01 00 00 00 0a 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 0003d0 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00
+; CHECK-NEXT: 0003e0 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 0003f0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000400 00 80 03 00 00 00 00 05 c4 6d e2 e3 d9 00 00 00
+
+; D_STR_DWO (.debug_str.dwo), EsdId=0xb
+; CHECK-NEXT: 000410 03 01 00 01 00 00 00 0b 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 000420 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00
+; CHECK-NEXT: 000430 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 000440 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000450 00 80 03 00 00 00 00 09 c4 6d e2 e3 d9 6d c4 e6
+; Continuation record:
+; CHECK-NEXT: 000460 03 02 00 d6 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000480 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0004a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_STROFFS_DWO (.debug_str_offsets.dwo), EsdId=0xc
+; CHECK-NEXT: 0004b0 03 01 00 01 00 00 00 0c 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 0004c0 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00
+; CHECK-NEXT: 0004d0 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 0004e0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 0004f0 00 80 03 00 00 00 00 0d c4 6d e2 e3 d9 d6 c6 c6
+; Continuation record:
+; CHECK-NEXT: 000500 03 02 00 e2 6d c4 e6 d6 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000510 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000540 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_INFO_DWO (.debug_info.dwo), EsdId=0xd
+; CHECK-NEXT: 000550 03 01 00 01 00 00 00 0d 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 000560 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00
+; CHECK-NEXT: 000570 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 000580 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000590 00 80 03 00 00 00 00 0a c4 6d c9 d5 c6 d6 6d c4
+; Continuation record:
+; CHECK-NEXT: 0005a0 03 02 00 e6 d6 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0005c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0005d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0005e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_ABREV_DWO (.debug_abbrev.dwo), EsdId=0xe
+; CHECK-NEXT: 0005f0 03 01 00 01 00 00 00 0e 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 000600 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00
+; CHECK-NEXT: 000610 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 000620 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000630 00 80 03 00 00 00 00 0b c4 6d c1 c2 d9 c5 e5 6d
+; Continuation record:
+; CHECK-NEXT: 000640 03 02 00 c4 e6 d6 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000650 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000670 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 000680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_LINE (.debug_line), EsdId=0x15
+; CHECK: 0008c0 03 00 00 01 00 00 00 15 00 00 00 01 00 00 00 00
+; CHECK-NEXT: 0008d0 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00
+; CHECK-NEXT: 0008e0 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; CHECK-NEXT: 0008f0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; CHECK-NEXT: 000900 00 80 03 00 00 00 00 06 c4 6d d3 c9 d5 c5 00 00
+
+; .debug_info TXT record (EsdId=9, D_INFO).
+; CHECK: 0011d0 03 10 00 00 00 00 00 09 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0011e0 00 00 00 00 00 00 00 24 00 00 00 20 00 04 00 00
+; CHECK-NEXT: 0011f0 00 00 08 01 00 00 00 00 00 00 00 00 00 00 00 05
+; CHECK-NEXT: 001200 c6 19 8a 80 b6 48 92 1c 00 00 00 00 00 00 00 00
+
+; .debug_str TXT record (EsdId=0xa, D_STR).
+; 2f 74 6d 70 = "/tmp" (line 2)
+; 66 6f 6f 2e 64 77 6f = "foo.dwo" (spans lines 2-3)
+; CHECK: 001220 03 10 00 00 00 00 00 0a 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 001230 00 00 00 00 00 00 00 0d 2f 74 6d 70 00 66 6f 6f
+; CHECK-NEXT: 001240 2e 64 77 6f 00 00 00 00 00 00 00 00 00 00 00 00
+
+; .debug_str.dwo TXT record (EsdId=0xb, D_STR_DWO).
+; 61 at offset 0x1288 = "a"
+; 69 6e 74 at offset 0x128a = "int"
+; 66 6f 6f 2e 63 at offset 0x128f = "foo.c" (spans lines 2-3)
+; 66 6f 6f 2e 64 77 6f at offset 0x1295 = "foo.dwo"
+; CHECK: 001270 03 10 00 00 00 00 00 0b 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 001280 00 00 00 00 00 00 00 15 61 00 69 6e 74 00 00 66
+; CHECK-NEXT: 001290 6f 6f 2e 63 00 66 6f 6f 2e 64 77 6f 00 00 00 00
+
+; .debug_str_offsets.dwo TXT record (EsdId=0xc, D_STROFFS_DWO).
+; CHECK: 0012c0 03 10 00 00 00 00 00 0c 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 0012d0 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 02
+; CHECK-NEXT: 0012e0 00 00 00 06 00 00 00 07 00 00 00 0d 00 00 00 00
+
+; .debug_info.dwo TXT record (EsdId=0xd, D_INFO_DWO).
+; CHECK: 001310 03 10 00 00 00 00 00 0d 00 00 00 00 00 00 00 00
+; CHECK-NEXT: 001320 00 00 00 00 00 00 00 29 00 00 00 25 00 04 00 00
+; CHECK-NEXT: 001330 00 00 08 01 02 00 0c 03 04 c6 19 8a 80 b6 48 92
+; CHECK-NEXT: 001340 1c 02 00 00 00 00 24 01 01 02 fb 00 03 01 05 04
diff --git a/llvm/test/DebugInfo/GOFF/fission-sections.ll b/llvm/test/DebugInfo/GOFF/fission-sections.ll
new file mode 100644
index 0000000000000..42009c3a354f6
--- /dev/null
+++ b/llvm/test/DebugInfo/GOFF/fission-sections.ll
@@ -0,0 +1,100 @@
+; RUN: llc -filetype=obj -mtriple=s390x-ibm-zos -split-dwarf-file=foo.dwo \
+; RUN: -split-dwarf-output=%t.dwo %s -o %t
+; RUN: od -Ax -tx1 -v %t | FileCheck --ignore-case --check-prefix=OBJ %s
+; RUN: od -Ax -tx1 -v %t.dwo | FileCheck --ignore-case --check-prefix=DWO %s
+
+; REQUIRES: systemz-registered-target
+
+ at a = common global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.c", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, isOptimized: false, runtimeVersion: 0, splitDebugFilename: "foo.dwo", emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+
+; D_ABREV (.debug_abbrev) ESD in .o
+; OBJ: 000320 03 00 00 01 00 00 00 08 00 00 00 01 00 00 00 00
+; OBJ-NEXT: 000330 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00
+; OBJ-NEXT: 000340 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; OBJ-NEXT: 000350 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; OBJ-NEXT: 000360 00 80 03 00 00 00 00 07 c4 6d c1 c2 d9 c5 e5 00
+
+; D_INFO (.debug_info) ESD in .o
+; OBJ-NEXT: 000370 03 00 00 01 00 00 00 09 00 00 00 01 00 00 00 00
+; OBJ-NEXT: 000380 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00
+; OBJ-NEXT: 000390 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; OBJ-NEXT: 0003a0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; OBJ-NEXT: 0003b0 00 80 03 00 00 00 00 06 c4 6d c9 d5 c6 d6 00 00
+
+; D_STR (.debug_str) ESD in .o
+; OBJ-NEXT: 0003c0 03 00 00 01 00 00 00 0a 00 00 00 01 00 00 00 00
+; OBJ-NEXT: 0003d0 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 00
+; OBJ-NEXT: 0003e0 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; OBJ-NEXT: 0003f0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; OBJ-NEXT: 000400 00 80 03 00 00 00 00 05 c4 6d e2 e3 d9 00 00 00
+
+; D_LINE (.debug_line) ESD in .o
+; OBJ: 000640 03 00 00 01 00 00 00 15 00 00 00 01 00 00 00 00
+; OBJ-NEXT: 000650 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00
+; OBJ-NEXT: 000660 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; OBJ-NEXT: 000670 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; OBJ-NEXT: 000680 00 80 03 00 00 00 00 06 c4 6d d3 c9 d5 c5 00 00
+
+; D_STR_DWO (.debug_str.dwo) ESD in foo.dwo
+; DWO: 000050 03 01 00 01 00 00 00 0b 00 00 00 01 00 00 00 00
+; DWO-NEXT: 000060 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00
+; DWO-NEXT: 000070 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; DWO-NEXT: 000080 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; DWO-NEXT: 000090 00 80 03 00 00 00 00 09 c4 6d e2 e3 d9 6d c4 e6
+; Continuation record:
+; DWO-NEXT: 0000a0 03 02 00 d6 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_STROFFS_DWO (.debug_str_offsets.dwo) ESD in foo.dwo
+; DWO-NEXT: 0000f0 03 01 00 01 00 00 00 0c 00 00 00 01 00 00 00 00
+; DWO-NEXT: 000100 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00
+; DWO-NEXT: 000110 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; DWO-NEXT: 000120 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; DWO-NEXT: 000130 00 80 03 00 00 00 00 0d c4 6d e2 e3 d9 d6 c6 c6
+; Continuation record:
+; DWO-NEXT: 000140 03 02 00 e2 6d c4 e6 d6 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_INFO_DWO (.debug_info.dwo) ESD in foo.dwo
+; DWO-NEXT: 000190 03 01 00 01 00 00 00 0d 00 00 00 01 00 00 00 00
+; DWO-NEXT: 0001a0 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00
+; DWO-NEXT: 0001b0 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; DWO-NEXT: 0001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; DWO-NEXT: 0001d0 00 80 03 00 00 00 00 0a c4 6d c9 d5 c6 d6 6d c4
+; Continuation record:
+; DWO-NEXT: 0001e0 03 02 00 e6 d6 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+; D_ABREV_DWO (.debug_abbrev.dwo) ESD in foo.dwo
+; DWO-NEXT: 000230 03 01 00 01 00 00 00 0e 00 00 00 01 00 00 00 00
+; DWO-NEXT: 000240 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00
+; DWO-NEXT: 000250 00 00 00 00 00 00 00 00 03 80 00 00 00 00 00 00
+; DWO-NEXT: 000260 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00
+; DWO-NEXT: 000270 00 80 03 00 00 00 00 0b c4 6d c1 c2 d9 c5 e5 6d
+; Continuation record:
+; DWO-NEXT: 000280 03 02 00 c4 e6 d6 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+; DWO-NEXT: 0002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
More information about the llvm-commits
mailing list