llvm/llvm/unittests/ObjCopy/ObjCopyTest.cpp

//===- ObjCopyTest.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 "llvm/ObjCopy/ObjCopy.h"
#include "llvm/ObjCopy/ConfigManager.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"

usingnamespacellvm;
usingnamespaceobject;
usingnamespaceobjcopy;
usingnamespaceyaml;

const char *SimpleFileCOFFYAML =;

const char *SimpleFileELFYAML =;

const char *SimpleFileMachOYAML =;

const char *SimpleFileWasmYAML =;

// Create ObjectFile from \p YamlCreationString and do validation using \p
// IsValidFormat checker. \p Storage is a storage for data. \returns created
// ObjectFile.
Expected<std::unique_ptr<ObjectFile>> createObjectFileFromYamlDescription(
    const char *YamlCreationString, SmallVector<char> &Storage,
    function_ref<bool(const Binary &File)> IsValidFormat) {}

// Call objcopy::executeObjcopyOnBinary for \p Config and \p In. \p DataVector
// is a holder for data. \returns Binary for copied data.
Expected<std::unique_ptr<Binary>>
callObjCopy(ConfigManager &Config, object::Binary &In,
            SmallVector<char> &DataVector,
            function_ref<bool(const Binary &File)> IsValidFormat) {}

// \returns true if specified \p File has a section named \p SectionName.
bool hasSection(ObjectFile &File, StringRef SectionName) {}

// Check that specified \p File has a section \p SectionName and its data
// matches \p SectionData.
void checkSectionData(ObjectFile &File, StringRef SectionName,
                      StringRef SectionData) {}

void copySimpleInMemoryFileImpl(
    const char *YamlCreationString,
    function_ref<bool(const Binary &File)> IsValidFormat) {}

TEST(CopySimpleInMemoryFile, COFF) {}

TEST(CopySimpleInMemoryFile, ELF) {}

TEST(CopySimpleInMemoryFile, MachO) {}

TEST(CopySimpleInMemoryFile, Wasm) {}

enum Action : uint8_t {};

void addOrUpdateSectionToFileImpl(
    const char *YamlCreationString,
    function_ref<bool(const Binary &File)> IsValidFormat,
    StringRef NewSectionName, StringRef NewSectionData, Action SectionAction) {}

TEST(AddSection, COFF) {}

TEST(AddSection, ELF) {}

TEST(AddSection, MachO) {}

TEST(AddSection, Wasm) {}

TEST(UpdateSection, COFF) {}

TEST(UpdateSection, ELF) {}

TEST(UpdateSection, MachO) {}

void removeSectionByPatternImpl(
    const char *YamlCreationString,
    function_ref<bool(const Binary &File)> IsValidFormat,
    StringRef SectionWildcard, StringRef SectionName) {}

TEST(RemoveSectionByPattern, COFF) {}

TEST(RemoveSectionByPattern, ELF) {}

TEST(RemoveSectionByPattern, MachO) {}

TEST(RemoveSectionByPattern, Wasm) {}