llvmpipe: Avoid LLVMGetGlobalContext in tests.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_test_blend.c
index 9139b83f05a238b1a6acdc4a1910c13461808c2d..13bed088bc5c4de6251c3aec4c71489408ef382f 100644 (file)
@@ -437,6 +437,7 @@ test_one(unsigned verbose,
          const struct pipe_blend_state *blend,
          struct lp_type type)
 {
+   LLVMContextRef context;
    struct gallivm_state *gallivm;
    LLVMValueRef func = NULL;
    blend_test_ptr_t blend_test_ptr;
@@ -450,7 +451,8 @@ test_one(unsigned verbose,
    if(verbose >= 1)
       dump_blend_type(stdout, blend, type);
 
-   gallivm = gallivm_create("test_module", LLVMGetGlobalContext());
+   context = LLVMContextCreate();
+   gallivm = gallivm_create("test_module", context);
 
    func = add_blend_test(gallivm, blend, type);
 
@@ -579,6 +581,7 @@ test_one(unsigned verbose,
       write_tsv_row(fp, blend, type, cycles_avg, success);
 
    gallivm_destroy(gallivm);
+   LLVMContextDispose(context);
 
    return success;
 }