mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
clean up expect code when not running tests
This commit is contained in:
parent
91ea71c7aa
commit
498004c554
3 changed files with 11 additions and 4 deletions
|
@ -21,12 +21,14 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
|||
|
||||
match env.mode {
|
||||
super::build::LlvmBackendMode::CliTest => {
|
||||
/* linkage is strong, which means this function is exposed */
|
||||
// expose this function
|
||||
let fn_val = module.get_function("set_mmapped_file").unwrap();
|
||||
fn_val.set_linkage(Linkage::External);
|
||||
}
|
||||
_ => {
|
||||
// set linkage to private, so it is DCE'd
|
||||
// remove this function from the module
|
||||
let fn_val = module.get_function("set_mmapped_file").unwrap();
|
||||
fn_val.set_linkage(Linkage::Private);
|
||||
unsafe { fn_val.delete() };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue