llvmpipe: Avoid LLVMGetGlobalContext in tests.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_test_printf.c
index fe4ce0fc5d7c74ecbd6d584c1bccad4250c56a80..3d3dc5838dcb053a38f2f002f2989e3a9d542763 100644 (file)
@@ -89,12 +89,14 @@ static boolean
 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("test_module", LLVMGetGlobalContext());
+   context = LLVMContextCreate();
+   gallivm = gallivm_create("test_module", context);
 
    test = add_printf_test(gallivm);
 
@@ -107,6 +109,7 @@ test_printf(unsigned verbose, FILE *fp,
    test_printf_func(0);
 
    gallivm_destroy(gallivm);
+   LLVMContextDispose(context);
 
    return success;
 }