llvm/llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp

//===-- SourcePrinter.cpp -  source interleaving utilities ----------------===//
//
// 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 "llvm/DebugInfo/BTF/BTFContext.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Testing/Support/Error.h"

usingnamespacellvm;
usingnamespacellvm::object;

#define LC(Line, Col)
#define ASSERT_SUCCEEDED(E)

const char BTFEndOfData[] =;
const char BTFExtEndOfData[] =;

static raw_ostream &operator<<(raw_ostream &OS, const yaml::BinaryRef &Ref) {}

template <typename T>
static yaml::BinaryRef makeBinRef(const T *Ptr, size_t Size = sizeof(T)) {}

namespace {
// This is a mockup for an ELF file containing .BTF and .BTF.ext sections.
// Binary content of these sections corresponds to the value of
// MockData1::BTF and MockData1::Ext fields.
//
// The yaml::yaml2ObjectFile() is used to generate actual ELF,
// see MockData1::makeObj().
//
// The `BTF` and `Ext` fields are initialized with correct values
// valid for a small example with a few sections, fields could be
// modified before a call to `makeObj()` to test parser with invalid
// input, etc.

struct MockData1 {};

TEST(BTFParserTest, simpleCorrectInput) {}

TEST(BTFParserTest, badSectionNameOffset) {}

// Keep this as macro to preserve line number info.
#define EXPECT_PARSE_ERROR(Mock, Message)

TEST(BTFParserTest, badBTFMagic) {}

TEST(BTFParserTest, badBTFVersion) {}

TEST(BTFParserTest, badBTFHdrLen) {}

TEST(BTFParserTest, badBTFSectionLen) {}

TEST(BTFParserTest, badBTFExtMagic) {}

TEST(BTFParserTest, badBTFExtVersion) {}

TEST(BTFParserTest, badBTFExtHdrLen) {}

TEST(BTFParserTest, badBTFExtSectionLen) {}

TEST(BTFParserTest, badBTFExtLineInfoRecSize) {}

TEST(BTFParserTest, badBTFExtLineSectionName) {}

TEST(BTFParserTest, missingSections) {}

// Check that BTFParser instance is reset when BTFParser::parse() is
// called several times.
TEST(BTFParserTest, parserReset) {}

TEST(BTFParserTest, btfContext) {}

static uint32_t mkInfo(uint32_t Kind) {}

template <typename T> static void append(std::string &S, const T &What) {}

class MockData2 {};

TEST(BTFParserTest, allTypeKinds) {}

TEST(BTFParserTest, bigStruct) {}

TEST(BTFParserTest, incompleteTypes) {}

// Use macro to preserve line number in error message.
#define SYMBOLIZE(SecAddr, Expected)

// Shorter name for initializers below.
SA;

TEST(BTFParserTest, typeRelocs) {}

TEST(BTFParserTest, enumRelocs) {}

TEST(BTFParserTest, enumRelocsMods) {}

TEST(BTFParserTest, fieldRelocs) {}

TEST(BTFParserTest, fieldRelocsMods) {}

TEST(BTFParserTest, relocTypeTagAndVoid) {}

TEST(BTFParserTest, longRelocModifiersCycle) {}

TEST(BTFParserTest, relocAnonFieldsAndTypes) {}

TEST(BTFParserTest, miscBadRelos) {}

TEST(BTFParserTest, relocsMultipleSections) {}

TEST(BTFParserTest, parserResetReloAndTypes) {}

TEST(BTFParserTest, selectiveLoad) {}

} // namespace