summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_test_printf.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-07-29 12:49:12 -0600
committerBrian Paul <brianp@vmware.com>2010-07-29 12:51:45 -0600
commitd05cb9f0187984e461b41eb1ba6ca2adf0593c74 (patch)
tree0be1dde26a25e4d9e00ea7836a8ecdcb64fc9374 /src/gallium/drivers/llvmpipe/lp_test_printf.c
parent8f3fe7e2f0a3ce1a5c45fd204b0105f3b501e641 (diff)
llvmpipe: don't call LLVMCreateJITCompiler() twice
Fixes a failed assertion with LLVM 2.6: <unnamed>::JITResolver::JITResolver(llvm::JIT&): Assertion `TheJITResolver == 0&& "Multiple JIT resolvers?"' failed. Though, not everyone seems to experience this problem.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_printf.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_printf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c
index 21df83f9d8..62041f0301 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_printf.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c
@@ -31,6 +31,7 @@
#include "util/u_pointer.h"
#include "gallivm/lp_bld.h"
+#include "gallivm/lp_bld_init.h"
#include "gallivm/lp_bld_printf.h"
#include <llvm-c/Analysis.h>
@@ -74,6 +75,7 @@ add_printf_test(LLVMModuleRef module)
lp_build_printf(builder, "hello, world\n");
lp_build_printf(builder, "print 5 6: %d %d\n", LLVMConstInt(LLVMInt32Type(), 5, 0),
LLVMConstInt(LLVMInt32Type(), 6, 0));
+
LLVMBuildRetVoid(builder);
LLVMDisposeBuilder(builder);
return func;
@@ -107,11 +109,15 @@ test_printf(unsigned verbose, FILE *fp, const struct printf_test_case *testcase)
LLVMDisposeMessage(error);
provider = LLVMCreateModuleProviderForExistingModule(module);
+#if 0
if (LLVMCreateJITCompiler(&engine, provider, 1, &error)) {
fprintf(stderr, "%s\n", error);
LLVMDisposeMessage(error);
abort();
}
+#else
+ engine = lp_build_engine;
+#endif
#if 0
pass = LLVMCreatePassManager();