test_gen: update wasm linking tests to work withx wasm3 runtime

This commit is contained in:
Brian Carroll 2022-07-10 01:05:19 +01:00 committed by Folkert
parent 6da71008cb
commit 0b0c54d676
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 38 additions and 65 deletions

View file

@ -185,9 +185,10 @@ where
.create_runtime(1024 * 60)
.expect("Unable to create runtime");
let module = Module::parse(&env, &wasm_bytes[..]).expect("Unable to parse module");
let mut module = rt.load_module(module).expect("Unable to load module");
let parsed_module = Module::parse(&env, &wasm_bytes[..]).expect("Unable to parse module");
let mut module = rt
.load_module(parsed_module)
.expect("Unable to load module");
let panic_msg: Rc<Mutex<Option<(i32, i32)>>> = Default::default();
let panic_msg_for_closure = panic_msg.clone();

View file

@ -27,9 +27,11 @@ export fn host_unused() i32 {
return 0x400 | js_unused() | js_called_directly_from_roc();
}
var host_result: i32 = 0;
// Result is an extern global so the test can read it from the Wasm module
extern var host_result: i32;
export fn read_host_result() i32 {
return host_result;
}
pub fn main() !void {
const host = host_called_directly_from_main();