llvm.org GIT mirror llvm / 18f0c67
fix PR5649 by making fib use the JIT instead of the interpreter, patch by Perry Lorier! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90186 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
1 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3333 #include "llvm/ExecutionEngine/Interpreter.h"
3434 #include "llvm/ExecutionEngine/GenericValue.h"
3535 #include "llvm/Support/raw_ostream.h"
36 #include "llvm/Target/TargetSelect.h"
3637 using namespace llvm;
3738
3839 static Function *CreateFibFunction(Module *M, LLVMContext &Context) {
9192 int main(int argc, char **argv) {
9293 int n = argc > 1 ? atol(argv[1]) : 24;
9394
95 InitializeNativeTarget();
9496 LLVMContext Context;
9597
9698 // Create some module to put our function into it.
100102 Function *FibF = CreateFibFunction(M, Context);
101103
102104 // Now we going to create JIT
103 ExecutionEngine *EE = EngineBuilder(M).create();
105 std::string errStr;
106 ExecutionEngine *EE = EngineBuilder(M).setErrorStr(&errStr).setEngineKind(EngineKind::JIT).create();
107
108 if (!EE) {
109 errs() << argv[0] << ": Failed to construct ExecutionEngine: " << errStr << "\n";
110 return 1;
111 }
104112
105113 errs() << "verifying... ";
106114 if (verifyModule(*M)) {