llvmpipe: Avoid LLVMGetGlobalContext in tests.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_test_arit.c
index f0582ff83e1e0b2a4d2ac35abbee20251d6e8241..875d51c5a38334d011dea363d828b993503231f3 100644 (file)
@@ -400,6 +400,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
 {
    char test_name[128];
    util_snprintf(test_name, sizeof test_name, "%s.v%u", test->name, length);
+   LLVMContextRef context;
    struct gallivm_state *gallivm;
    LLVMValueRef test_func;
    unary_func_t test_func_jit;
@@ -415,7 +416,8 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
       in[i] = 1.0;
    }
 
-   gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+   context = LLVMContextCreate();
+   gallivm = gallivm_create("test_module", context);
 
    test_func = build_unary_test_func(gallivm, test, length, test_name);
 
@@ -486,6 +488,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
    }
 
    gallivm_destroy(gallivm);
+   LLVMContextDispose(context);
 
    align_free(in);
    align_free(out);