update host files after recent code gen changes

This commit is contained in:
Folkert 2020-11-02 16:29:51 +01:00
parent 497adb2ec4
commit eedf746ec7
5 changed files with 41 additions and 21 deletions

View file

@ -164,12 +164,12 @@ mod cli_run {
#[test]
#[serial(multi_dep_str)]
fn run_multi_dep_str() {
if true {
todo!(
"fix this test so it no longer deadlocks and hangs during monomorphization! The test never shows the error; to see the panic error, run this: cargo run run cli/tests/fixtures/multi-dep-str/Main.roc"
);
}
fn run_multi_dep_str_unoptimized() {
// if true {
// todo!(
// "fix this test so it no longer deadlocks and hangs during monomorphization! The test never shows the error; to see the panic error, run this: cargo run run cli/tests/fixtures/multi-dep-str/Main.roc"
// );
// }
check_output(
&fixture_file("multi-dep-str", "Main.roc"),
@ -198,7 +198,7 @@ mod cli_run {
#[test]
#[serial(multi_dep_thunk)]
fn run_multi_dep_thunk() {
fn run_multi_dep_thunk_unoptimized() {
check_output(
&fixture_file("multi-dep-thunk", "Main.roc"),
&[],

View file

@ -8,6 +8,6 @@ edition = "2018"
crate-type = ["staticlib"]
[dependencies]
roc_std = { path = "../../../roc_std" }
roc_std = { path = "../../../../../roc_std" }
[workspace]

View file

@ -1,17 +1,27 @@
use roc_std::RocCallResult;
use roc_std::RocStr;
use std::str;
extern "C" {
#[link_name = "main_1"]
fn main() -> RocStr;
#[link_name = "main_1_exposed"]
fn say_hello(output: &mut RocCallResult<RocStr>) -> ();
}
#[no_mangle]
pub fn rust_main() -> isize {
println!(
"Roc says: {}",
str::from_utf8(unsafe { main().as_slice() }).unwrap()
);
let answer = unsafe {
use std::mem::MaybeUninit;
let mut output: MaybeUninit<RocCallResult<RocStr>> = MaybeUninit::uninit();
say_hello(&mut *output.as_mut_ptr());
match output.assume_init().into() {
Ok(value) => value,
Err(msg) => panic!("roc failed with message {}", msg),
}
};
println!("Roc says: {}", str::from_utf8(answer.as_slice()).unwrap());
// Exit code
0

View file

@ -8,6 +8,6 @@ edition = "2018"
crate-type = ["staticlib"]
[dependencies]
roc_std = { path = "../../../roc_std" }
roc_std = { path = "../../../../../roc_std" }
[workspace]

View file

@ -1,17 +1,27 @@
use roc_std::RocCallResult;
use roc_std::RocStr;
use std::str;
extern "C" {
#[link_name = "main_1"]
fn main() -> RocStr;
#[link_name = "main_1_exposed"]
fn say_hello(output: &mut RocCallResult<RocStr>) -> ();
}
#[no_mangle]
pub fn rust_main() -> isize {
println!(
"Roc says: {}",
str::from_utf8(unsafe { main().as_slice() }).unwrap()
);
let answer = unsafe {
use std::mem::MaybeUninit;
let mut output: MaybeUninit<RocCallResult<RocStr>> = MaybeUninit::uninit();
say_hello(&mut *output.as_mut_ptr());
match output.assume_init().into() {
Ok(value) => value,
Err(msg) => panic!("roc failed with message {}", msg),
}
};
println!("Roc says: {}", str::from_utf8(answer.as_slice()).unwrap());
// Exit code
0