llvm/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

//===- llvm/unittest/DebugInfo/DWARFDebugInfoTest.cpp ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "DwarfGenerator.h"
#include "DwarfUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
#include "llvm/DebugInfo/DWARF/DWARFVerifier.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/ObjectYAML/DWARFEmitter.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
#include <string>

// AIX doesn't support debug_str_offsets or debug_addr sections
#ifdef _AIX
#define NO_SUPPORT_DEBUG_STR_OFFSETS
#define NO_SUPPORT_DEBUG_ADDR
#endif

usingnamespacellvm;
usingnamespacedwarf;
usingnamespaceutils;

namespace {

template <uint16_t Version, class AddrType, class RefAddrType>
void TestAllForms() {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr4AllForms) {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr8AllForms) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr4AllForms) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr8AllForms) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr4AllForms) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr8AllForms) {}

#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version5Addr4AllForms) {
#else
TEST(DWARFDebugInfo, TestDWARF32Version5Addr4AllForms) {}

#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version5Addr8AllForms) {
#else
TEST(DWARFDebugInfo, TestDWARF32Version5Addr8AllForms) {}

template <uint16_t Version, class AddrType> void TestChildren() {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr4Children) {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr8Children) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr4Children) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr8Children) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr4Children) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr8Children) {}

template <uint16_t Version, class AddrType> void TestReferences() {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr4References) {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr8References) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr4References) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr8References) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr4References) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr8References) {}

template <uint16_t Version, class AddrType> void TestAddresses() {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr4Addresses) {}

TEST(DWARFDebugInfo, TestDWARF32Version2Addr8Addresses) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr4Addresses) {}

TEST(DWARFDebugInfo, TestDWARF32Version3Addr8Addresses) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr4Addresses) {}

TEST(DWARFDebugInfo, TestDWARF32Version4Addr8Addresses) {}

#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
TEST(DWARFDebugInfo, DISABLED_TestStringOffsets) {
#else
TEST(DWARFDebugInfo, TestStringOffsets) {}

#ifdef NO_SUPPORT_DEBUG_ADDR
TEST(DWARFDebugInfo, DISABLED_TestEmptyStringOffsets) {
#else
TEST(DWARFDebugInfo, TestEmptyStringOffsets) {}

TEST(DWARFDebugInfo, TestRelations) {}

TEST(DWARFDebugInfo, TestDWARFDie) {}

TEST(DWARFDebugInfo, TestChildIterators) {}

TEST(DWARFDebugInfo, TestChildIteratorsOnInvalidDie) {}

TEST(DWARFDebugInfo, TestEmptyChildren) {}

TEST(DWARFDebugInfo, TestAttributeIterators) {}

TEST(DWARFDebugInfo, TestFindRecurse) {}

TEST(DWARFDebugInfo, TestSelfRecursiveType) {}

TEST(DWARFDebugInfo, TestDwarfToFunctions) {}

TEST(DWARFDebugInfo, TestFindAttrs) {}

#ifdef NO_SUPPORT_DEBUG_ADDR
TEST(DWARFDebugInfo, DISABLED_TestImplicitConstAbbrevs) {
#else
TEST(DWARFDebugInfo, TestImplicitConstAbbrevs) {}

TEST(DWARFDebugInfo, TestDWARFDieRangeInfoContains) {}

namespace {

void AssertRangesIntersect(const DWARFAddressRange &LHS,
                           const DWARFAddressRange &RHS) {}
void AssertRangesDontIntersect(const DWARFAddressRange &LHS,
                               const DWARFAddressRange &RHS) {}

void AssertRangesIntersect(const DWARFVerifier::DieRangeInfo &LHS,
                           const DWARFAddressRangesVector &Ranges) {}

void AssertRangesDontIntersect(const DWARFVerifier::DieRangeInfo &LHS,
                               const DWARFAddressRangesVector &Ranges) {}

} // namespace
TEST(DWARFDebugInfo, TestDwarfRangesIntersect) {}

TEST(DWARFDebugInfo, TestDWARFDieRangeInfoIntersects) {}

TEST(DWARFDebugInfo, TestDWARF64UnitLength) {}

} // end anonymous namespace