Merge branch 'trunk' into dev-backend-num-is-zero

This commit is contained in:
satotake 2021-11-22 15:25:25 +00:00 committed by GitHub
commit 0085272cb8
40 changed files with 1382 additions and 892 deletions

View file

@ -358,7 +358,7 @@ fn u8_hex_int_alias() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn dec_float_alias() {
assert_evals_to!(
indoc!(

View file

@ -16,11 +16,10 @@ use roc_std::{RocList, RocStr};
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn width_and_alignment_u8_u8() {
use roc_mono::layout::Builtin;
use roc_mono::layout::Layout;
use roc_mono::layout::UnionLayout;
let t = &[Layout::Builtin(Builtin::Int8)] as &[_];
let t = &[Layout::u8()] as &[_];
let tt = [t, t];
let layout = Layout::Union(UnionLayout::NonRecursive(&tt));

View file

@ -5,6 +5,9 @@ use roc_can::builtins::builtin_defs_map;
use roc_collections::all::MutMap;
use tempfile::tempdir;
#[allow(unused_imports)]
use roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS;
#[allow(dead_code)]
fn promote_expr_to_module(src: &str) -> String {
let mut buffer = String::from("app \"test\" provides [ main ] to \"./platform\"\n\nmain =\n");
@ -77,7 +80,14 @@ pub fn helper(
// while you're working on the dev backend!
{
// println!("=========== Procedures ==========");
// println!("{:?}", procedures);
// if PRETTY_PRINT_IR_SYMBOLS {
// println!("");
// for proc in procedures.values() {
// println!("{}", proc.to_pretty(200));
// }
// } else {
// println!("{:?}", procedures.values());
// }
// println!("=================================\n");
// println!("=========== Interns ==========");

View file

@ -17,6 +17,9 @@ use roc_gen_wasm::wasm_module::{
};
use roc_gen_wasm::MEMORY_NAME;
#[allow(unused_imports)]
use roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS;
const TEST_WRAPPER_NAME: &str = "test_wrapper";
std::thread_local! {
@ -60,6 +63,7 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
}
let exposed_types = MutMap::default();
let ptr_bytes = 4;
let loaded = roc_load::file::load_and_monomorphize_from_str(
arena,
filename,
@ -67,7 +71,7 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
stdlib,
src_dir,
exposed_types,
8,
ptr_bytes,
builtin_defs_map,
);
@ -83,19 +87,26 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
// You can comment and uncomment this block out to get more useful information
// while you're working on the wasm backend!
// {
// println!("=========== Procedures ==========");
// println!("{:?}", procedures);
// println!("=================================\n");
{
// println!("=========== Procedures ==========");
// if PRETTY_PRINT_IR_SYMBOLS {
// println!("");
// for proc in procedures.values() {
// println!("{}", proc.to_pretty(200));
// }
// } else {
// println!("{:?}", procedures.values());
// }
// println!("=================================\n");
// println!("=========== Interns ==========");
// println!("{:?}", interns);
// println!("=================================\n");
// println!("=========== Interns ==========");
// println!("{:?}", interns);
// println!("=================================\n");
// println!("=========== Exposed ==========");
// println!("{:?}", exposed_to_host);
// println!("=================================\n");
// }
// println!("=========== Exposed ==========");
// println!("{:?}", exposed_to_host);
// println!("=================================\n");
}
debug_assert_eq!(exposed_to_host.len(), 1);