test_printf(unsigned verbose, FILE *fp,
const struct printf_test_case *testcase)
{
+ LLVMContextRef context;
struct gallivm_state *gallivm;
LLVMValueRef test;
test_printf_t test_printf_func;
boolean success = TRUE;
- gallivm = gallivm_create();
+ context = LLVMContextCreate();
+ gallivm = gallivm_create("test_module", context);
test = add_printf_test(gallivm);
test_printf_func = (test_printf_t) gallivm_jit_function(gallivm, test);
- test_printf_func(0);
+ gallivm_free_ir(gallivm);
- gallivm_free_function(gallivm, test, test_printf_func);
+ test_printf_func(0);
gallivm_destroy(gallivm);
+ LLVMContextDispose(context);
return success;
}