Allow testing interface modules

This commit is contained in:
Richard Feldman 2022-08-03 12:00:39 -04:00
parent afb857d3e9
commit 3136c5fb63
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
11 changed files with 218 additions and 182 deletions

View file

@ -4,7 +4,7 @@ use inkwell::context::Context;
use roc_build::link::llvm_module_to_dylib;
use roc_collections::{MutSet, VecMap};
use roc_gen_llvm::llvm::{build::LlvmBackendMode, externs::add_default_roc_externs};
use roc_load::{Expectations, MonomorphizedModule};
use roc_load::{EntryPoint, Expectations, MonomorphizedModule};
use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_mono::ir::OptLevel;
use roc_region::all::Region;
@ -299,6 +299,15 @@ pub fn expect_mono_module_to_dylib<'a>(
// platform to provide them.
add_default_roc_externs(&env);
let entry_point = match entry_point {
EntryPoint::Executable { symbol, layout, .. } => {
roc_mono::ir::EntryPoint { symbol, layout }
}
EntryPoint::Test => {
unreachable!()
}
};
let expect_names = roc_gen_llvm::llvm::build::build_procedures_expose_expects(
&env,
opt_level,