#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LEB128.h"
#include "llvm/TargetParser/Host.h"
#include "gtest/gtest.h"
#include <climits>
usingnamespacellvm;
usingnamespacedwarf;
namespace {
bool isFormClass(dwarf::Form Form, DWARFFormValue::FormClass FC) { … }
TEST(DWARFFormValue, FormClass) { … }
template<typename RawTypeT>
DWARFFormValue createDataXFormValue(dwarf::Form Form, RawTypeT Value) { … }
DWARFFormValue createULEBFormValue(uint64_t Value) { … }
DWARFFormValue createSLEBFormValue(int64_t Value) { … }
TEST(DWARFFormValue, SignedConstantForms) { … }
ParamType;
struct FormSkipValueFixtureBase : public testing::TestWithParam<ParamType> { … };
template <typename T> static ArrayRef<uint8_t> toBytes(const T &Input) { … }
const uint8_t LEBData[] = …;
ArrayRef<uint8_t> SampleLEB(LEBData, sizeof(LEBData));
const uint8_t SampleLength8 = …;
const uint16_t SampleLength16 = …;
const uint32_t SampleLength = …;
ArrayRef<uint8_t> SampleU8 = …;
ArrayRef<uint8_t> SampleU16 = …;
ArrayRef<uint8_t> SampleU32 = …;
const uint8_t StringData[] = …;
ArrayRef<uint8_t> SampleString(StringData, sizeof(StringData));
const uint8_t IndirectData8[] = …;
const uint8_t IndirectData16[] = …;
const uint8_t IndirectAddr[] = …;
const uint8_t IndirectIndirectData1[] = …;
const uint8_t IndirectIndirectEnd[] = …;
struct FormSkipValueFixture1 : FormSkipValueFixtureBase { … };
struct FormSkipValueFixture2 : FormSkipValueFixtureBase { … };
TEST_P(FormSkipValueFixture1, skipValuePart1) { … }
TEST_P(FormSkipValueFixture2, skipValuePart2) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
ErrorParams;
struct ExtractValueErrorFixture : public testing::TestWithParam<ErrorParams> { … };
TEST_P(ExtractValueErrorFixture, Test) { … }
INSTANTIATE_TEST_SUITE_P(…);
DumpValueParams;
struct DumpValueFixture : public testing::TestWithParam<DumpValueParams> { … };
TEST_P(DumpValueFixture, Test) { … }
const uint32_t DumpTestSample32Val = …;
ArrayRef<uint8_t> DumpTestSample32 = …;
const uint64_t DumpTestSample64Val = …;
ArrayRef<uint8_t> DumpTestSample64 = …;
INSTANTIATE_TEST_SUITE_P(…);
}