#define LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTBASE_H
#include "MCJITTestAPICommon.h"
+#include "llvm/AsmParser/Parser.h"
#include "llvm/Config/config.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeBuilder.h"
#include "llvm/Support/CodeGen.h"
+#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/raw_ostream.h"
namespace llvm {
assert(TheJIT.get() != NULL && "error creating MCJIT with EngineBuilder");
}
+ void createJITFromAssembly(const char *Test) {
+ SMDiagnostic Error;
+ M = parseAssemblyString(Test, Error, Context);
+
+ std::string errMsg;
+ raw_string_ostream os(errMsg);
+ Error.print("", os);
+
+ // A failure here means that the test itself is buggy.
+ if (!M)
+ report_fatal_error(os.str().c_str());
+
+ createJIT(std::move(M));
+ }
+
CodeGenOpt::Level OptLevel;
Reloc::Model RelocModel;
CodeModel::Model CodeModel;