llvm/llvm/unittests/Object/ELFObjectFileTest.cpp

//===- ELFObjectFileTest.cpp - Tests for ELFObjectFile --------------------===//
//
// 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/Object/ELFObjectFile.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/BlockFrequency.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"

#include "llvm/Support/thread.h"
#include "llvm/TargetParser/Host.h"

usingnamespacellvm;
usingnamespacellvm::object;

namespace {

// A struct to initialize a buffer to represent an ELF object file.
struct DataForTest {};

void checkFormatAndArch(const DataForTest &D, StringRef Fmt,
                        Triple::ArchType Arch) {}

std::array<DataForTest, 4> generateData(uint16_t Machine) {}

} // namespace

TEST(ELFObjectFileTest, MachineTestForNoneOrUnused) {}

TEST(ELFObjectFileTest, MachineTestForVE) {}

TEST(ELFObjectFileTest, MachineTestForX86_64) {}

TEST(ELFObjectFileTest, MachineTestFor386) {}

TEST(ELFObjectFileTest, MachineTestForMIPS) {}

TEST(ELFObjectFileTest, MachineTestForAMDGPU) {}

TEST(ELFObjectFileTest, MachineTestForIAMCU) {}

TEST(ELFObjectFileTest, MachineTestForAARCH64) {}

TEST(ELFObjectFileTest, MachineTestForPPC64) {}

TEST(ELFObjectFileTest, MachineTestForPPC) {}

TEST(ELFObjectFileTest, MachineTestForRISCV) {}

TEST(ELFObjectFileTest, MachineTestForARM) {}

TEST(ELFObjectFileTest, MachineTestForS390) {}

TEST(ELFObjectFileTest, MachineTestForSPARCV9) {}

TEST(ELFObjectFileTest, MachineTestForSPARC) {}

TEST(ELFObjectFileTest, MachineTestForSPARC32PLUS) {}

TEST(ELFObjectFileTest, MachineTestForBPF) {}

TEST(ELFObjectFileTest, MachineTestForAVR) {}

TEST(ELFObjectFileTest, MachineTestForHEXAGON) {}

TEST(ELFObjectFileTest, MachineTestForLANAI) {}

TEST(ELFObjectFileTest, MachineTestForMSP430) {}

TEST(ELFObjectFileTest, MachineTestForLoongArch) {}

TEST(ELFObjectFileTest, MachineTestForCSKY) {}

TEST(ELFObjectFileTest, MachineTestForXtensa) {}

TEST(ELFObjectFileTest, CheckOSAndTriple) {}

// ELF relative relocation type test.
TEST(ELFObjectFileTest, RelativeRelocationTypeTest) {}

template <class ELFT>
static Expected<ELFObjectFile<ELFT>> toBinary(SmallVectorImpl<char> &Storage,
                                              StringRef Yaml) {}

// Check we are able to create an ELFObjectFile even when the content of the
// SHT_SYMTAB_SHNDX section can't be read properly.
TEST(ELFObjectFileTest, InvalidSymtabShndxTest) {}

// Test that we are able to create an ELFObjectFile even when loadable segments
// are unsorted by virtual address.
// Test that ELFFile<ELFT>::toMappedAddr works properly in this case.

TEST(ELFObjectFileTest, InvalidLoadSegmentsOrderTest) {}

// This is a test for API that is related to symbols.
// We check that errors are properly reported here.
TEST(ELFObjectFileTest, InvalidSymbolTest) {}

// Tests for error paths of the ELFFile::decodeBBAddrMap API.
TEST(ELFObjectFileTest, InvalidDecodeBBAddrMap) {}

// Test for the ELFObjectFile::readBBAddrMap API.
TEST(ELFObjectFileTest, ReadBBAddrMap) {}

// Tests for error paths of the ELFFile::decodeBBAddrMap with PGOAnalysisMap
// API.
TEST(ELFObjectFileTest, InvalidDecodePGOAnalysisMap) {}

// Test for the ELFObjectFile::readBBAddrMap API with PGOAnalysisMap.
TEST(ELFObjectFileTest, ReadPGOAnalysisMap) {}

// Test for ObjectFile::getRelocatedSection: check that it returns a relocated
// section for executable and relocatable files.
TEST(ELFObjectFileTest, ExecutableWithRelocs) {}

TEST(ELFObjectFileTest, GetSectionAndRelocations) {}

TEST(ELFObjectFileTest, ELFSymbolRefLess) {}