#include "MCJITTestAPICommon.h"
#include "llvm-c/Analysis.h"
#include "llvm-c/Core.h"
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/Target.h"
#include "llvm-c/Transforms/PassBuilder.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/Support/Debug.h"
#include "llvm/TargetParser/Host.h"
#include "gtest/gtest.h"
usingnamespacellvm;
static bool didCallAllocateCodeSection;
static bool didAllocateCompactUnwindSection;
static bool didCallYield;
static uint8_t *roundTripAllocateCodeSection(void *object, uintptr_t size,
unsigned alignment,
unsigned sectionID,
const char *sectionName) { … }
static uint8_t *roundTripAllocateDataSection(void *object, uintptr_t size,
unsigned alignment,
unsigned sectionID,
const char *sectionName,
LLVMBool isReadOnly) { … }
static LLVMBool roundTripFinalizeMemory(void *object, char **errMsg) { … }
static void roundTripDestroy(void *object) { … }
static void yield(LLVMContextRef, void *) { … }
namespace {
class TestReserveAllocationSpaceMemoryManager: public SectionMemoryManager { … };
class MCJITCAPITest : public testing::Test, public MCJITTestAPICommon { … };
}
TEST_F(MCJITCAPITest, simple_function) { … }
TEST_F(MCJITCAPITest, gva) { … }
TEST_F(MCJITCAPITest, gfa) { … }
TEST_F(MCJITCAPITest, custom_memory_manager) { … }
TEST_F(MCJITCAPITest, stackmap_creates_compact_unwind_on_darwin) { … }
#if defined(__APPLE__) && defined(__aarch64__)
#define MAYBE_reserve_allocation_space …
#else
#define MAYBE_reserve_allocation_space …
#endif
TEST_F(MCJITCAPITest, MAYBE_reserve_allocation_space) { … }
TEST_F(MCJITCAPITest, yield) { … }
static int localTestFunc() { … }
TEST_F(MCJITCAPITest, addGlobalMapping) { … }