update the tests

This commit is contained in:
Folkert 2022-01-26 15:59:21 +01:00
parent c663a35e16
commit b9c318e9fb
13 changed files with 29 additions and 18 deletions

View file

@ -23,9 +23,9 @@ fn width_and_alignment_u8_u8() {
let layout = Layout::Union(UnionLayout::NonRecursive(&tt));
let ptr_width = 8;
assert_eq!(layout.alignment_bytes(ptr_width), 1);
assert_eq!(layout.stack_size(ptr_width), 2);
let target_info = roc_target::TargetInfo::default_x86_64();
assert_eq!(layout.alignment_bytes(target_info), 1);
assert_eq!(layout.stack_size(target_info), 2);
}
#[test]

View file

@ -57,7 +57,7 @@ pub fn helper(
&stdlib,
src_dir,
exposed_types,
8,
roc_target::TargetInfo::default_x86_64(),
builtin_defs_map,
);

View file

@ -42,6 +42,8 @@ fn create_llvm_module<'a>(
) -> (&'static str, String, &'a Module<'a>) {
use std::path::{Path, PathBuf};
let target_info = roc_target::TargetInfo::from(target);
let filename = PathBuf::from("Test.roc");
let src_dir = Path::new("fake/test/path");
@ -56,8 +58,6 @@ fn create_llvm_module<'a>(
module_src = &temp;
}
let ptr_bytes = target.pointer_width().unwrap().bytes() as u32;
let exposed_types = MutMap::default();
let loaded = roc_load::file::load_and_monomorphize_from_str(
arena,
@ -66,7 +66,7 @@ fn create_llvm_module<'a>(
stdlib,
src_dir,
exposed_types,
ptr_bytes,
target_info,
test_builtin_defs,
);
@ -213,7 +213,7 @@ fn create_llvm_module<'a>(
context,
interns,
module,
target_info: ptr_bytes,
target_info,
is_gen_test,
// important! we don't want any procedures to get the C calling convention
exposed_to_host: MutSet::default(),

View file

@ -94,7 +94,6 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32TestResult>(
}
let exposed_types = MutMap::default();
let ptr_bytes = 4;
let loaded = roc_load::file::load_and_monomorphize_from_str(
arena,
filename,
@ -102,7 +101,7 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32TestResult>(
stdlib,
src_dir,
exposed_types,
ptr_bytes,
roc_target::TargetInfo::default_wasm32(),
builtin_defs_map,
);