#include <llvm/BinaryFormat/ELF.h>
#include <llvm/ExecutionEngine/JITLink/aarch32.h>
#include "gtest/gtest.h"
usingnamespacellvm;
usingnamespacellvm::jitlink;
usingnamespacellvm::jitlink::aarch32;
usingnamespacellvm::support;
usingnamespacellvm::support::endian;
struct MutableHalfWords { … };
struct MutableWord { … };
namespace llvm {
namespace jitlink {
Expected<aarch32::EdgeKind_aarch32>
getJITLinkEdgeKind(uint32_t ELFType, const aarch32::ArmConfig &Cfg);
Expected<uint32_t> getELFRelocationType(Edge::Kind Kind);
}
}
TEST(AArch32_ELF, EdgeKinds) { … }
TEST(AArch32_ELF, DynFixupInfos) { … }
namespace llvm {
namespace jitlink {
namespace aarch32 {
HalfWords encodeImmBT4BlT1BlxT2(int64_t Value);
HalfWords encodeImmBT4BlT1BlxT2_J1J2(int64_t Value);
uint32_t encodeImmBA1BlA1BlxA2(int64_t Value);
HalfWords encodeImmMovtT1MovwT3(uint16_t Value);
HalfWords encodeRegMovtT1MovwT3(int64_t Value);
uint32_t encodeImmMovtA1MovwA2(uint16_t Value);
uint32_t encodeRegMovtA1MovwA2(int64_t Value);
int64_t decodeImmBT4BlT1BlxT2(uint32_t Hi, uint32_t Lo);
int64_t decodeImmBT4BlT1BlxT2_J1J2(uint32_t Hi, uint32_t Lo);
int64_t decodeImmBA1BlA1BlxA2(int64_t Value);
uint16_t decodeImmMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
int64_t decodeRegMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
uint16_t decodeImmMovtA1MovwA2(uint64_t Value);
int64_t decodeRegMovtA1MovwA2(uint64_t Value);
}
}
}
template <endianness Endian>
static HalfWords makeHalfWords(std::array<uint8_t, 4> Mem) { … }
TEST(AArch32_Relocations, Thumb_Call_J1J2) { … }
TEST(AArch32_Relocations, Thumb_Call_Bare) { … }
TEST(AArch32_Relocations, Arm_Call_Bare) { … }
TEST(AArch32_Relocations, Thumb_MovtAbs) { … }
TEST(AArch32_Relocations, Arm_MovtAbs) { … }