mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-28 21:47:57 +03:00
LLVM unit tests: fix - parse bitcode in context
This commit is contained in:
parent
b6a03d20a3
commit
454dc540f2
2 changed files with 3 additions and 3 deletions
|
@ -33,7 +33,7 @@ use std::{i8, ptr};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use llvm_zluda::analysis::{LLVMVerifierFailureAction, LLVMVerifyModule};
|
use llvm_zluda::analysis::{LLVMVerifierFailureAction, LLVMVerifyModule};
|
||||||
use llvm_zluda::bit_reader::LLVMParseBitcode2;
|
use llvm_zluda::bit_reader::LLVMParseBitcodeInContext2;
|
||||||
use llvm_zluda::bit_writer::LLVMWriteBitcodeToMemoryBuffer;
|
use llvm_zluda::bit_writer::LLVMWriteBitcodeToMemoryBuffer;
|
||||||
use llvm_zluda::{core::*, *};
|
use llvm_zluda::{core::*, *};
|
||||||
use llvm_zluda::{prelude::*, LLVMZludaBuildAtomicRMW};
|
use llvm_zluda::{prelude::*, LLVMZludaBuildAtomicRMW};
|
||||||
|
@ -158,7 +158,8 @@ impl MemoryBuffer {
|
||||||
if p_module.is_null() {
|
if p_module.is_null() {
|
||||||
handle_alloc_error(layout);
|
handle_alloc_error(layout);
|
||||||
}
|
}
|
||||||
LLVMParseBitcode2(self.0, p_module as *mut LLVMModuleRef);
|
let context = Context::new();
|
||||||
|
LLVMParseBitcodeInContext2(context.0, self.0, p_module as *mut LLVMModuleRef);
|
||||||
let asm = LLVMPrintModuleToString(*(p_module as *mut LLVMModuleRef));
|
let asm = LLVMPrintModuleToString(*(p_module as *mut LLVMModuleRef));
|
||||||
LLVMDisposeModule(*(p_module as *mut LLVMModuleRef));
|
LLVMDisposeModule(*(p_module as *mut LLVMModuleRef));
|
||||||
dealloc(p_module, layout);
|
dealloc(p_module, layout);
|
||||||
|
|
|
@ -33,7 +33,6 @@ macro_rules! test_ptx {
|
||||||
#[test]
|
#[test]
|
||||||
fn [<$fn_name _llvm>]() -> Result<(), Box<dyn std::error::Error>> {
|
fn [<$fn_name _llvm>]() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let fn_name = stringify!($fn_name);
|
let fn_name = stringify!($fn_name);
|
||||||
println!("{}", fn_name);
|
|
||||||
let ptx = include_str!(concat!(stringify!($fn_name), ".ptx"));
|
let ptx = include_str!(concat!(stringify!($fn_name), ".ptx"));
|
||||||
let ll = include_str!(concat!("../ll/", stringify!($fn_name), ".ll")).trim();
|
let ll = include_str!(concat!("../ll/", stringify!($fn_name), ".ll")).trim();
|
||||||
test_llvm_assert(ptx, &ll)
|
test_llvm_assert(ptx, &ll)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue