diff --git a/spectests/README.md b/spectests/README.md index 2057dce55..248cd5792 100644 --- a/spectests/README.md +++ b/spectests/README.md @@ -88,7 +88,6 @@ This spectests are currently covered: - names.wast ✅ - nop.wast - return.wast ✅ -- run.py - select.wast ✅ - set_local.wast ✅ - skip-stack-guard-page.wast @@ -122,3 +121,5 @@ There are some cases that we decided to skip for now to fasten the time to relea - `globals.wast` - `loop.wast` - `if.wast` +- `SKIP_MUTABLE_GLOBALS`: Right now the WASM parser can't validate a module with imported/exported mut globals. We decided to skip the tests until Cranelift and wasmparser can handle this (original spec proposal: https://github.com/WebAssembly/mutable-global). Files modified: + - `globals.wast` diff --git a/spectests/data.wast b/spectests/data.wast index 46b95436f..3573d2e6e 100644 --- a/spectests/data.wast +++ b/spectests/data.wast @@ -47,27 +47,31 @@ (data (i32.const 1) "h") ) -(module - (global (import "spectest" "global_i32") i32) - (memory 1) - (data (get_global 0) "a") -) -(module - (global (import "spectest" "global_i32") i32) - (import "spectest" "memory" (memory 1)) - (data (get_global 0) "a") -) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global (import "spectest" "global_i32") i32) +;; (memory 1) +;; (data (get_global 0) "a") +;; ) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global (import "spectest" "global_i32") i32) +;; (import "spectest" "memory" (memory 1)) +;; (data (get_global 0) "a") +;; ) -(module - (global $g (import "spectest" "global_i32") i32) - (memory 1) - (data (get_global $g) "a") -) -(module - (global $g (import "spectest" "global_i32") i32) - (import "spectest" "memory" (memory 1)) - (data (get_global $g) "a") -) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global $g (import "spectest" "global_i32") i32) +;; (memory 1) +;; (data (get_global $g) "a") +;; ) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global $g (import "spectest" "global_i32") i32) +;; (import "spectest" "memory" (memory 1)) +;; (data (get_global $g) "a") +;; ) ;; Use of internal globals in constant expressions is not allowed in MVP. ;; (module (memory 1) (data (get_global 0) "a") (global i32 (i32.const 0))) @@ -134,17 +138,19 @@ (data (i32.const 0) "a") ) -(module - (global (import "spectest" "global_i32") i32) - (import "spectest" "memory" (memory 0)) - (data (get_global 0) "a") -) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global (import "spectest" "global_i32") i32) +;; (import "spectest" "memory" (memory 0)) +;; (data (get_global 0) "a") +;; ) -(module - (global (import "spectest" "global_i32") i32) - (import "spectest" "memory" (memory 0 3)) - (data (get_global 0) "a") -) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (global (import "spectest" "global_i32") i32) +;; (import "spectest" "memory" (memory 0 3)) +;; (data (get_global 0) "a") +;; ) (module (import "spectest" "memory" (memory 0)) diff --git a/spectests/globals.wast b/spectests/globals.wast index 8965b8df5..d50395ee4 100644 --- a/spectests/globals.wast +++ b/spectests/globals.wast @@ -247,8 +247,11 @@ ) ;; mutable globals can be exported -(module (global (mut f32) (f32.const 0)) (export "a" (global 0))) -(module (global (export "a") (mut f32) (f32.const 0))) +;; SKIP_MUTABLE_GLOBALS +;; (module (global (mut f32) (f32.const 0)) (export "a" (global 0))) + +;; SKIP_MUTABLE_GLOBALS +;; (module (global (export "a") (mut f32) (f32.const 0))) (assert_invalid (module (global f32 (f32.neg (f32.const 0)))) @@ -300,9 +303,11 @@ "unknown global" ) -(module - (import "spectest" "global_i32" (global i32)) -) +;; SKIP_MUTABLE_GLOBALS +;; (module +;; (import "spectest" "global_i32" (global i32)) +;; ) + (assert_malformed (module binary "\00asm" "\01\00\00\00" diff --git a/src/build_spectests.rs b/src/build_spectests.rs index d0abb56e8..a1b9a8305 100644 --- a/src/build_spectests.rs +++ b/src/build_spectests.rs @@ -224,6 +224,22 @@ fn test_module_{}() {{ ) .as_str(), ); + + // We set the start call to the module + let start_module_call = format!("start_module_{}", self.last_module); + self.buffer.push_str( + format!( + "fn {}(result_object: &ResultObject, vm_context: &VmCtx) {{ + result_object.instance.start(&vm_context); +}}\n", + start_module_call + ) + .as_str(), + ); + self.module_calls + .entry(self.last_module) + .or_insert(Vec::new()) + .push(start_module_call); } fn visit_assert_invalid(&mut self, module: &ModuleBinary) { diff --git a/src/spectests/_common.rs b/src/spectests/_common.rs index a0c276473..ea1113399 100644 --- a/src/spectests/_common.rs +++ b/src/spectests/_common.rs @@ -1,11 +1,14 @@ use crate::webassembly::ImportObject; -extern fn print_i32(num: i32) { +extern "C" fn print_i32(num: i32) { println!("{}", num); } +static GLOBAL_I32: i32 = 666; + pub fn spectest_importobject<'a, 'b>() -> ImportObject<&'a str, &'b str> { let mut import_object = ImportObject::new(); import_object.set("spectest", "print_i32", print_i32 as *const u8); - return import_object + import_object.set("spectest", "global_i32", GLOBAL_I32 as *const u8); + return import_object; } diff --git a/src/spectests/address.rs b/src/spectests/address.rs index 055f4f7da..cfb1e6009 100644 --- a/src/spectests/address.rs +++ b/src/spectests/address.rs @@ -146,6 +146,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 104 fn c1_l104_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1072,6 +1075,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l104_action_invoke(&result_object, &vm_context); c2_l105_action_invoke(&result_object, &vm_context); c3_l106_action_invoke(&result_object, &vm_context); @@ -1332,6 +1336,9 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 355 fn c88_l355_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2618,6 +2625,7 @@ fn test_module_2() { let result_object = create_module_2(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_2(&result_object, &vm_context); c88_l355_action_invoke(&result_object, &vm_context); c89_l356_action_invoke(&result_object, &vm_context); c90_l357_action_invoke(&result_object, &vm_context); @@ -2758,6 +2766,9 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 523 fn c208_l523_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2941,6 +2952,7 @@ fn test_module_3() { let result_object = create_module_3(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_3(&result_object, &vm_context); c208_l523_action_invoke(&result_object, &vm_context); c209_l524_action_invoke(&result_object, &vm_context); c210_l525_action_invoke(&result_object, &vm_context); @@ -2991,6 +3003,9 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 570 fn c226_l570_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -3172,6 +3187,7 @@ fn test_module_4() { let result_object = create_module_4(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_4(&result_object, &vm_context); c226_l570_action_invoke(&result_object, &vm_context); c227_l571_action_invoke(&result_object, &vm_context); c228_l572_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/align.rs b/src/spectests/align.rs index d634af544..b6c91228c 100644 --- a/src/spectests/align.rs +++ b/src/spectests/align.rs @@ -23,8 +23,19 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 4 + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} fn create_module_2() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -37,8 +48,19 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 5 + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} fn create_module_3() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -51,8 +73,19 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 6 + +#[test] +fn test_module_3() { + let result_object = create_module_3(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_3(&result_object, &vm_context); +} fn create_module_4() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -65,8 +98,19 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 7 + +#[test] +fn test_module_4() { + let result_object = create_module_4(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_4(&result_object, &vm_context); +} fn create_module_5() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -79,8 +123,19 @@ fn create_module_5() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_5(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 8 + +#[test] +fn test_module_5() { + let result_object = create_module_5(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_5(&result_object, &vm_context); +} fn create_module_6() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -93,8 +148,19 @@ fn create_module_6() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_6(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 9 + +#[test] +fn test_module_6() { + let result_object = create_module_6(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_6(&result_object, &vm_context); +} fn create_module_7() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -107,8 +173,19 @@ fn create_module_7() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 10 + +#[test] +fn test_module_7() { + let result_object = create_module_7(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_7(&result_object, &vm_context); +} fn create_module_8() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -121,8 +198,19 @@ fn create_module_8() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_8(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 11 + +#[test] +fn test_module_8() { + let result_object = create_module_8(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_8(&result_object, &vm_context); +} fn create_module_9() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -135,8 +223,19 @@ fn create_module_9() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_9(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 12 + +#[test] +fn test_module_9() { + let result_object = create_module_9(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_9(&result_object, &vm_context); +} fn create_module_10() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -149,8 +248,19 @@ fn create_module_10() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_10(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 13 + +#[test] +fn test_module_10() { + let result_object = create_module_10(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_10(&result_object, &vm_context); +} fn create_module_11() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -163,8 +273,19 @@ fn create_module_11() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_11(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 14 + +#[test] +fn test_module_11() { + let result_object = create_module_11(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_11(&result_object, &vm_context); +} fn create_module_12() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -177,8 +298,19 @@ fn create_module_12() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_12(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 15 + +#[test] +fn test_module_12() { + let result_object = create_module_12(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_12(&result_object, &vm_context); +} fn create_module_13() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -191,8 +323,19 @@ fn create_module_13() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_13(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 16 + +#[test] +fn test_module_13() { + let result_object = create_module_13(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_13(&result_object, &vm_context); +} fn create_module_14() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -205,8 +348,19 @@ fn create_module_14() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_14(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 17 + +#[test] +fn test_module_14() { + let result_object = create_module_14(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_14(&result_object, &vm_context); +} fn create_module_15() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -219,8 +373,19 @@ fn create_module_15() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_15(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 18 + +#[test] +fn test_module_15() { + let result_object = create_module_15(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_15(&result_object, &vm_context); +} fn create_module_16() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -233,8 +398,19 @@ fn create_module_16() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_16(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 19 + +#[test] +fn test_module_16() { + let result_object = create_module_16(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_16(&result_object, &vm_context); +} fn create_module_17() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -247,8 +423,19 @@ fn create_module_17() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_17(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 20 + +#[test] +fn test_module_17() { + let result_object = create_module_17(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_17(&result_object, &vm_context); +} fn create_module_18() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -261,8 +448,19 @@ fn create_module_18() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_18(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 21 + +#[test] +fn test_module_18() { + let result_object = create_module_18(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_18(&result_object, &vm_context); +} fn create_module_19() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -275,8 +473,19 @@ fn create_module_19() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_19(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 22 + +#[test] +fn test_module_19() { + let result_object = create_module_19(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_19(&result_object, &vm_context); +} fn create_module_20() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -289,8 +498,19 @@ fn create_module_20() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_20(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 23 + +#[test] +fn test_module_20() { + let result_object = create_module_20(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_20(&result_object, &vm_context); +} fn create_module_21() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -303,8 +523,19 @@ fn create_module_21() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_21(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 24 + +#[test] +fn test_module_21() { + let result_object = create_module_21(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_21(&result_object, &vm_context); +} fn create_module_22() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -317,8 +548,19 @@ fn create_module_22() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_22(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 25 + +#[test] +fn test_module_22() { + let result_object = create_module_22(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_22(&result_object, &vm_context); +} fn create_module_23() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -331,6 +573,9 @@ fn create_module_23() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_23(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 28 #[test] @@ -997,6 +1242,14 @@ fn c105_l452_assert_invalid() { } // Line 458 + +#[test] +fn test_module_23() { + let result_object = create_module_23(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_23(&result_object, &vm_context); +} fn create_module_24() -> ResultObject { let module_str = "(module (type (;0;) (func (param i32) (result f32))) @@ -1568,6 +1821,9 @@ fn create_module_24() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_24(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 802 fn c107_l802_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2126,6 +2382,7 @@ fn test_module_24() { let result_object = create_module_24(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_24(&result_object, &vm_context); c107_l802_action_invoke(&result_object, &vm_context); c108_l803_action_invoke(&result_object, &vm_context); c109_l804_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/block.rs b/src/spectests/block.rs index f71bbb490..b004bb74b 100644 --- a/src/spectests/block.rs +++ b/src/spectests/block.rs @@ -530,6 +530,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 252 fn c1_l252_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2024,6 +2027,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l252_action_invoke(&result_object, &vm_context); c2_l253_action_invoke(&result_object, &vm_context); c3_l254_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/br.rs b/src/spectests/br.rs index fa2610e8b..abfdf14c9 100644 --- a/src/spectests/br.rs +++ b/src/spectests/br.rs @@ -562,6 +562,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 334 fn c1_l334_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1380,6 +1383,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l334_action_invoke(&result_object, &vm_context); c2_l335_action_invoke(&result_object, &vm_context); c3_l336_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/br_if.rs b/src/spectests/br_if.rs index 6e91dd330..46c43f077 100644 --- a/src/spectests/br_if.rs +++ b/src/spectests/br_if.rs @@ -574,6 +574,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 334 fn c1_l334_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1720,6 +1723,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l334_action_invoke(&result_object, &vm_context); c2_l335_action_invoke(&result_object, &vm_context); c3_l336_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/br_table.rs b/src/spectests/br_table.rs index 55aba5f56..87f805875 100644 --- a/src/spectests/br_table.rs +++ b/src/spectests/br_table.rs @@ -781,6 +781,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 1247 fn c1_l1247_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2659,6 +2662,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l1247_action_invoke(&result_object, &vm_context); c2_l1248_action_invoke(&result_object, &vm_context); c3_l1249_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/break_drop.rs b/src/spectests/break_drop.rs index 1f229c7e8..f4955b156 100644 --- a/src/spectests/break_drop.rs +++ b/src/spectests/break_drop.rs @@ -35,6 +35,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 7 fn c1_l7_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -77,6 +80,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l7_action_invoke(&result_object, &vm_context); c2_l8_action_invoke(&result_object, &vm_context); c3_l9_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/call.rs b/src/spectests/call.rs index 681d25e79..d5469510f 100644 --- a/src/spectests/call.rs +++ b/src/spectests/call.rs @@ -316,6 +316,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 202 fn c1_l202_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1048,6 +1051,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l202_action_invoke(&result_object, &vm_context); c2_l203_action_invoke(&result_object, &vm_context); c3_l204_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/call_indirect.rs b/src/spectests/call_indirect.rs index 88b210106..ea390aeba 100644 --- a/src/spectests/call_indirect.rs +++ b/src/spectests/call_indirect.rs @@ -512,6 +512,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 388 fn c1_l388_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1904,6 +1907,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l388_action_invoke(&result_object, &vm_context); c2_l389_action_invoke(&result_object, &vm_context); c3_l390_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/const_.rs b/src/spectests/const_.rs index f310c58b2..11bdd8827 100644 --- a/src/spectests/const_.rs +++ b/src/spectests/const_.rs @@ -21,8 +21,19 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 6 + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} fn create_module_2() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -33,6 +44,9 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 8 #[test] @@ -51,6 +65,14 @@ fn c3_l12_assert_malformed() { } // Line 16 + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} fn create_module_3() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -61,8 +83,19 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 17 + +#[test] +fn test_module_3() { + let result_object = create_module_3(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_3(&result_object, &vm_context); +} fn create_module_4() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -73,6 +106,9 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 19 #[test] @@ -91,6 +127,14 @@ fn c7_l23_assert_malformed() { } // Line 27 + +#[test] +fn test_module_4() { + let result_object = create_module_4(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_4(&result_object, &vm_context); +} fn create_module_5() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -101,8 +145,19 @@ fn create_module_5() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_5(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 28 + +#[test] +fn test_module_5() { + let result_object = create_module_5(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_5(&result_object, &vm_context); +} fn create_module_6() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -113,6 +168,9 @@ fn create_module_6() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_6(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 30 #[test] @@ -131,6 +189,14 @@ fn c11_l34_assert_malformed() { } // Line 38 + +#[test] +fn test_module_6() { + let result_object = create_module_6(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_6(&result_object, &vm_context); +} fn create_module_7() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -141,8 +207,19 @@ fn create_module_7() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 39 + +#[test] +fn test_module_7() { + let result_object = create_module_7(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_7(&result_object, &vm_context); +} fn create_module_8() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -153,6 +230,9 @@ fn create_module_8() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_8(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 41 #[test] @@ -171,6 +251,14 @@ fn c15_l45_assert_malformed() { } // Line 49 + +#[test] +fn test_module_8() { + let result_object = create_module_8(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_8(&result_object, &vm_context); +} fn create_module_9() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -181,8 +269,19 @@ fn create_module_9() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_9(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 50 + +#[test] +fn test_module_9() { + let result_object = create_module_9(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_9(&result_object, &vm_context); +} fn create_module_10() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -193,8 +292,19 @@ fn create_module_10() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_10(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 51 + +#[test] +fn test_module_10() { + let result_object = create_module_10(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_10(&result_object, &vm_context); +} fn create_module_11() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -205,8 +315,19 @@ fn create_module_11() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_11(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 52 + +#[test] +fn test_module_11() { + let result_object = create_module_11(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_11(&result_object, &vm_context); +} fn create_module_12() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -217,8 +338,19 @@ fn create_module_12() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_12(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 53 + +#[test] +fn test_module_12() { + let result_object = create_module_12(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_12(&result_object, &vm_context); +} fn create_module_13() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -229,8 +361,19 @@ fn create_module_13() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_13(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 54 + +#[test] +fn test_module_13() { + let result_object = create_module_13(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_13(&result_object, &vm_context); +} fn create_module_14() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -241,6 +384,9 @@ fn create_module_14() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_14(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 56 #[test] @@ -275,6 +421,14 @@ fn c25_l68_assert_malformed() { } // Line 72 + +#[test] +fn test_module_14() { + let result_object = create_module_14(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_14(&result_object, &vm_context); +} fn create_module_15() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -285,8 +439,19 @@ fn create_module_15() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_15(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 73 + +#[test] +fn test_module_15() { + let result_object = create_module_15(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_15(&result_object, &vm_context); +} fn create_module_16() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -297,6 +462,9 @@ fn create_module_16() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_16(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 75 #[test] @@ -315,6 +483,14 @@ fn c29_l79_assert_malformed() { } // Line 83 + +#[test] +fn test_module_16() { + let result_object = create_module_16(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_16(&result_object, &vm_context); +} fn create_module_17() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -325,8 +501,19 @@ fn create_module_17() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_17(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 84 + +#[test] +fn test_module_17() { + let result_object = create_module_17(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_17(&result_object, &vm_context); +} fn create_module_18() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -337,6 +524,9 @@ fn create_module_18() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_18(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 86 #[test] @@ -355,6 +545,14 @@ fn c33_l90_assert_malformed() { } // Line 94 + +#[test] +fn test_module_18() { + let result_object = create_module_18(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_18(&result_object, &vm_context); +} fn create_module_19() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -365,8 +563,19 @@ fn create_module_19() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_19(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 95 + +#[test] +fn test_module_19() { + let result_object = create_module_19(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_19(&result_object, &vm_context); +} fn create_module_20() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -377,8 +586,19 @@ fn create_module_20() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_20(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 96 + +#[test] +fn test_module_20() { + let result_object = create_module_20(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_20(&result_object, &vm_context); +} fn create_module_21() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -389,8 +609,19 @@ fn create_module_21() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_21(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 97 + +#[test] +fn test_module_21() { + let result_object = create_module_21(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_21(&result_object, &vm_context); +} fn create_module_22() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -401,8 +632,19 @@ fn create_module_22() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_22(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 98 + +#[test] +fn test_module_22() { + let result_object = create_module_22(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_22(&result_object, &vm_context); +} fn create_module_23() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -413,8 +655,19 @@ fn create_module_23() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_23(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 99 + +#[test] +fn test_module_23() { + let result_object = create_module_23(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_23(&result_object, &vm_context); +} fn create_module_24() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -425,6 +678,9 @@ fn create_module_24() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_24(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 101 #[test] @@ -459,6 +715,14 @@ fn c43_l113_assert_malformed() { } // Line 117 + +#[test] +fn test_module_24() { + let result_object = create_module_24(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_24(&result_object, &vm_context); +} fn create_module_25() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -469,8 +733,19 @@ fn create_module_25() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_25(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 118 + +#[test] +fn test_module_25() { + let result_object = create_module_25(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_25(&result_object, &vm_context); +} fn create_module_26() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -481,6 +756,9 @@ fn create_module_26() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_26(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 120 #[test] @@ -499,6 +777,14 @@ fn c47_l124_assert_malformed() { } // Line 128 + +#[test] +fn test_module_26() { + let result_object = create_module_26(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_26(&result_object, &vm_context); +} fn create_module_27() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -509,8 +795,19 @@ fn create_module_27() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_27(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 129 + +#[test] +fn test_module_27() { + let result_object = create_module_27(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_27(&result_object, &vm_context); +} fn create_module_28() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -521,6 +818,9 @@ fn create_module_28() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_28(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 131 #[test] @@ -537,3 +837,11 @@ fn c51_l135_assert_malformed() { let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is malformed"); } + +#[test] +fn test_module_28() { + let result_object = create_module_28(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_28(&result_object, &vm_context); +} diff --git a/src/spectests/conversions.rs b/src/spectests/conversions.rs index 05d5cccf7..25cc556cd 100644 --- a/src/spectests/conversions.rs +++ b/src/spectests/conversions.rs @@ -129,6 +129,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 29 fn c1_l29_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -4017,6 +4020,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l29_action_invoke(&result_object, &vm_context); c2_l30_action_invoke(&result_object, &vm_context); c3_l31_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/data.rs b/src/spectests/data.rs index fa2f68841..1eefb0281 100644 --- a/src/spectests/data.rs +++ b/src/spectests/data.rs @@ -30,8 +30,19 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 23 + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} fn create_module_2() -> ResultObject { let module_str = "(module (memory (;0;) 1) @@ -40,8 +51,19 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 27 + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} fn create_module_3() -> ResultObject { let module_str = "(module (import \"spectest\" \"memory\" (memory (;0;) 1)) @@ -50,8 +72,19 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 32 + +#[test] +fn test_module_3() { + let result_object = create_module_3(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_3(&result_object, &vm_context); +} fn create_module_4() -> ResultObject { let module_str = "(module (memory (;0;) 1) @@ -64,8 +97,19 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 40 + +#[test] +fn test_module_4() { + let result_object = create_module_4(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_4(&result_object, &vm_context); +} fn create_module_5() -> ResultObject { let module_str = "(module (import \"spectest\" \"memory\" (memory (;0;) 1)) @@ -79,75 +123,64 @@ fn create_module_5() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_5(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 50 +// Line 82 + +#[test] +fn test_module_5() { + let result_object = create_module_5(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_5(&result_object, &vm_context); +} fn create_module_6() -> ResultObject { let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) (memory (;0;) 1) - (data (get_global 0) \"a\")) + (data (i32.const 0) \"a\") + (data (i32.const 65535) \"b\")) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_6(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 55 +// Line 87 + +#[test] +fn test_module_6() { + let result_object = create_module_6(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_6(&result_object, &vm_context); +} fn create_module_7() -> ResultObject { let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) (import \"spectest\" \"memory\" (memory (;0;) 1)) - (data (get_global 0) \"a\")) + (data (i32.const 0) \"a\") + (data (i32.const 65535) \"b\")) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 61 +// Line 93 + +#[test] +fn test_module_7() { + let result_object = create_module_7(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_7(&result_object, &vm_context); +} fn create_module_8() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) - (memory (;0;) 1) - (data (get_global 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 66 -fn create_module_9() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) - (import \"spectest\" \"memory\" (memory (;0;) 1)) - (data (get_global 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 78 -fn create_module_10() -> ResultObject { - let module_str = "(module - (memory (;0;) 1) - (data (i32.const 0) \"a\") - (data (i32.const 65535) \"b\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 83 -fn create_module_11() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"memory\" (memory (;0;) 1)) - (data (i32.const 0) \"a\") - (data (i32.const 65535) \"b\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 89 -fn create_module_12() -> ResultObject { let module_str = "(module (memory (;0;) 2) (data (i32.const 131071) \"a\")) @@ -155,8 +188,103 @@ fn create_module_12() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_8(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 94 +// Line 98 + +#[test] +fn test_module_8() { + let result_object = create_module_8(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_8(&result_object, &vm_context); +} +fn create_module_9() -> ResultObject { + let module_str = "(module + (memory (;0;) 0) + (data (i32.const 0) \"\")) + "; + let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); + instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") +} +fn start_module_9(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} + +// Line 102 + +#[test] +fn test_module_9() { + let result_object = create_module_9(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_9(&result_object, &vm_context); +} +fn create_module_10() -> ResultObject { + let module_str = "(module + (import \"spectest\" \"memory\" (memory (;0;) 0)) + (data (i32.const 0) \"\")) + "; + let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); + instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") +} +fn start_module_10(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} + +// Line 107 + +#[test] +fn test_module_10() { + let result_object = create_module_10(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_10(&result_object, &vm_context); +} +fn create_module_11() -> ResultObject { + let module_str = "(module + (memory (;0;) 0 0) + (data (i32.const 0) \"\")) + "; + let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); + instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") +} +fn start_module_11(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} + +// Line 112 + +#[test] +fn test_module_11() { + let result_object = create_module_11(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_11(&result_object, &vm_context); +} +fn create_module_12() -> ResultObject { + let module_str = "(module + (memory (;0;) 1) + (data (i32.const 65536) \"\")) + "; + let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); + instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") +} +fn start_module_12(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} + +// Line 117 + +#[test] +fn test_module_12() { + let result_object = create_module_12(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_12(&result_object, &vm_context); +} fn create_module_13() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -165,8 +293,19 @@ fn create_module_13() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_13(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 98 +// Line 121 + +#[test] +fn test_module_13() { + let result_object = create_module_13(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_13(&result_object, &vm_context); +} fn create_module_14() -> ResultObject { let module_str = "(module (import \"spectest\" \"memory\" (memory (;0;) 0)) @@ -175,8 +314,19 @@ fn create_module_14() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_14(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 103 +// Line 126 + +#[test] +fn test_module_14() { + let result_object = create_module_14(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_14(&result_object, &vm_context); +} fn create_module_15() -> ResultObject { let module_str = "(module (memory (;0;) 0 0) @@ -185,101 +335,83 @@ fn create_module_15() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_15(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 108 +// Line 131 + +#[test] +fn test_module_15() { + let result_object = create_module_15(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_15(&result_object, &vm_context); +} fn create_module_16() -> ResultObject { let module_str = "(module - (memory (;0;) 1) - (data (i32.const 65536) \"\")) + (import \"spectest\" \"memory\" (memory (;0;) 0)) + (data (i32.const 0) \"a\")) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_16(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 113 +// Line 136 + +#[test] +fn test_module_16() { + let result_object = create_module_16(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_16(&result_object, &vm_context); +} fn create_module_17() -> ResultObject { let module_str = "(module - (memory (;0;) 0) - (data (i32.const 0) \"\")) + (import \"spectest\" \"memory\" (memory (;0;) 0 3)) + (data (i32.const 0) \"a\")) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_17(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 117 +// Line 155 + +#[test] +fn test_module_17() { + let result_object = create_module_17(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_17(&result_object, &vm_context); +} fn create_module_18() -> ResultObject { let module_str = "(module (import \"spectest\" \"memory\" (memory (;0;) 0)) - (data (i32.const 0) \"\")) + (data (i32.const 1) \"a\")) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_18(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 122 +// Line 160 + +#[test] +fn test_module_18() { + let result_object = create_module_18(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_18(&result_object, &vm_context); +} fn create_module_19() -> ResultObject { - let module_str = "(module - (memory (;0;) 0 0) - (data (i32.const 0) \"\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 127 -fn create_module_20() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"memory\" (memory (;0;) 0)) - (data (i32.const 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 132 -fn create_module_21() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"memory\" (memory (;0;) 0 3)) - (data (i32.const 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 137 -fn create_module_22() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) - (import \"spectest\" \"memory\" (memory (;0;) 0)) - (data (get_global 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 143 -fn create_module_23() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32)) - (import \"spectest\" \"memory\" (memory (;0;) 0 3)) - (data (get_global 0) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 149 -fn create_module_24() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"memory\" (memory (;0;) 0)) - (data (i32.const 1) \"a\")) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 154 -fn create_module_25() -> ResultObject { let module_str = "(module (import \"spectest\" \"memory\" (memory (;0;) 0 3)) (data (i32.const 1) \"a\")) @@ -287,79 +419,90 @@ fn create_module_25() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_19(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 162 +// Line 168 -// Line 170 +// Line 176 -// Line 178 +// Line 184 -// Line 186 +// Line 192 -// Line 194 +// Line 200 -// Line 211 +// Line 217 -// Line 220 +// Line 226 -// Line 227 +// Line 233 -// Line 235 +// Line 241 -// Line 243 +// Line 249 -// Line 251 +// Line 257 -// Line 258 +// Line 264 -// Line 266 +// Line 272 -// Line 273 +// Line 279 -// Line 283 +// Line 289 #[test] -fn c39_l283_assert_invalid() { +fn c33_l289_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 11, 6, 1, 0, 65, 0, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 292 +// Line 298 #[test] -fn c40_l292_assert_invalid() { +fn c34_l298_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 6, 1, 0, 66, 0, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 300 +// Line 306 #[test] -fn c41_l300_assert_invalid() { +fn c35_l306_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 7, 1, 0, 65, 0, 104, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 308 +// Line 314 #[test] -fn c42_l308_assert_invalid() { +fn c36_l314_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 5, 1, 0, 1, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 316 +// Line 322 #[test] -fn c43_l316_assert_invalid() { +fn c37_l322_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 7, 1, 0, 1, 65, 0, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 324 +// Line 330 #[test] -fn c44_l324_assert_invalid() { +fn c38_l330_assert_invalid() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 7, 1, 0, 65, 0, 1, 11, 0]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } + +#[test] +fn test_module_19() { + let result_object = create_module_19(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_19(&result_object, &vm_context); +} diff --git a/src/spectests/endianness.rs b/src/spectests/endianness.rs index 995065461..f9448a9b2 100644 --- a/src/spectests/endianness.rs +++ b/src/spectests/endianness.rs @@ -221,6 +221,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 133 fn c1_l133_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1043,6 +1046,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l133_action_invoke(&result_object, &vm_context); c2_l134_action_invoke(&result_object, &vm_context); c3_l135_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/exports.rs b/src/spectests/exports.rs index a99798f75..b13113ba2 100644 --- a/src/spectests/exports.rs +++ b/src/spectests/exports.rs @@ -20,8 +20,19 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 4 + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} fn create_module_2() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -32,8 +43,19 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 5 + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} fn create_module_3() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -45,8 +67,19 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 7 + +#[test] +fn test_module_3() { + let result_object = create_module_3(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_3(&result_object, &vm_context); +} fn create_module_4() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -56,8 +89,19 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 8 + +#[test] +fn test_module_4() { + let result_object = create_module_4(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_4(&result_object, &vm_context); +} fn create_module_5() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -69,8 +113,19 @@ fn create_module_5() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_5(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 9 + +#[test] +fn test_module_5() { + let result_object = create_module_5(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_5(&result_object, &vm_context); +} fn create_module_6() -> ResultObject { let module_str = "(module (type (;0;) (func (param i32))) @@ -81,8 +136,19 @@ fn create_module_6() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_6(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 10 + +#[test] +fn test_module_6() { + let result_object = create_module_6(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_6(&result_object, &vm_context); +} fn create_module_7() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -92,8 +158,19 @@ fn create_module_7() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 11 + +#[test] +fn test_module_7() { + let result_object = create_module_7(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_7(&result_object, &vm_context); +} fn create_module_8() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -103,8 +180,19 @@ fn create_module_8() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_8(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 12 + +#[test] +fn test_module_8() { + let result_object = create_module_8(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_8(&result_object, &vm_context); +} fn create_module_9() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -114,8 +202,19 @@ fn create_module_9() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_9(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 13 + +#[test] +fn test_module_9() { + let result_object = create_module_9(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_9(&result_object, &vm_context); +} fn create_module_10() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -125,8 +224,19 @@ fn create_module_10() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_10(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 14 + +#[test] +fn test_module_10() { + let result_object = create_module_10(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_10(&result_object, &vm_context); +} fn create_module_11() -> ResultObject { let module_str = "(module (type (;0;) (func)) @@ -136,8 +246,19 @@ fn create_module_11() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_11(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 16 + +#[test] +fn test_module_11() { + let result_object = create_module_11(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_11(&result_object, &vm_context); +} fn create_module_12() -> ResultObject { let module_str = "(module (type (;0;) (func (param i32) (result i32))) @@ -151,6 +272,9 @@ fn create_module_12() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_12(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 22 fn c12_l22_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -231,6 +355,7 @@ fn test_module_12() { let result_object = create_module_12(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_12(&result_object, &vm_context); c12_l22_action_invoke(&result_object, &vm_context); c13_l23_action_invoke(&result_object, &vm_context); } @@ -242,8 +367,19 @@ fn create_module_13() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_13(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 57 + +#[test] +fn test_module_13() { + let result_object = create_module_13(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_13(&result_object, &vm_context); +} fn create_module_14() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -253,8 +389,19 @@ fn create_module_14() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_14(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 58 + +#[test] +fn test_module_14() { + let result_object = create_module_14(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_14(&result_object, &vm_context); +} fn create_module_15() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -265,8 +412,19 @@ fn create_module_15() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_15(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 60 + +#[test] +fn test_module_15() { + let result_object = create_module_15(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_15(&result_object, &vm_context); +} fn create_module_16() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -275,8 +433,19 @@ fn create_module_16() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_16(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 61 + +#[test] +fn test_module_16() { + let result_object = create_module_16(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_16(&result_object, &vm_context); +} fn create_module_17() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -285,8 +454,19 @@ fn create_module_17() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_17(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 62 + +#[test] +fn test_module_17() { + let result_object = create_module_17(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_17(&result_object, &vm_context); +} fn create_module_18() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -295,8 +475,19 @@ fn create_module_18() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_18(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 63 + +#[test] +fn test_module_18() { + let result_object = create_module_18(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_18(&result_object, &vm_context); +} fn create_module_19() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -305,8 +496,19 @@ fn create_module_19() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_19(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 64 + +#[test] +fn test_module_19() { + let result_object = create_module_19(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_19(&result_object, &vm_context); +} fn create_module_20() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -315,8 +517,19 @@ fn create_module_20() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_20(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 65 + +#[test] +fn test_module_20() { + let result_object = create_module_20(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_20(&result_object, &vm_context); +} fn create_module_21() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0)) @@ -325,8 +538,19 @@ fn create_module_21() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_21(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 67 + +#[test] +fn test_module_21() { + let result_object = create_module_21(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_21(&result_object, &vm_context); +} fn create_module_22() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 42)) @@ -335,6 +559,9 @@ fn create_module_22() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_22(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 71 @@ -389,6 +616,14 @@ fn c37_l98_assert_invalid() { } // Line 105 + +#[test] +fn test_module_22() { + let result_object = create_module_22(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_22(&result_object, &vm_context); +} fn create_module_23() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -397,8 +632,19 @@ fn create_module_23() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_23(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 106 + +#[test] +fn test_module_23() { + let result_object = create_module_23(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_23(&result_object, &vm_context); +} fn create_module_24() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -408,8 +654,19 @@ fn create_module_24() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_24(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 110 + +#[test] +fn test_module_24() { + let result_object = create_module_24(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_24(&result_object, &vm_context); +} fn create_module_25() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -418,8 +675,19 @@ fn create_module_25() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_25(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 111 + +#[test] +fn test_module_25() { + let result_object = create_module_25(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_25(&result_object, &vm_context); +} fn create_module_26() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -428,8 +696,19 @@ fn create_module_26() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_26(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 112 + +#[test] +fn test_module_26() { + let result_object = create_module_26(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_26(&result_object, &vm_context); +} fn create_module_27() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -438,8 +717,19 @@ fn create_module_27() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_27(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 113 + +#[test] +fn test_module_27() { + let result_object = create_module_27(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_27(&result_object, &vm_context); +} fn create_module_28() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -448,8 +738,19 @@ fn create_module_28() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_28(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 114 + +#[test] +fn test_module_28() { + let result_object = create_module_28(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_28(&result_object, &vm_context); +} fn create_module_29() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -458,8 +759,19 @@ fn create_module_29() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_29(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 115 + +#[test] +fn test_module_29() { + let result_object = create_module_29(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_29(&result_object, &vm_context); +} fn create_module_30() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -468,8 +780,19 @@ fn create_module_30() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_30(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 116 + +#[test] +fn test_module_30() { + let result_object = create_module_30(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_30(&result_object, &vm_context); +} fn create_module_31() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -478,8 +801,19 @@ fn create_module_31() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_31(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 117 + +#[test] +fn test_module_31() { + let result_object = create_module_31(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_31(&result_object, &vm_context); +} fn create_module_32() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -488,8 +822,19 @@ fn create_module_32() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_32(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 118 + +#[test] +fn test_module_32() { + let result_object = create_module_32(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_32(&result_object, &vm_context); +} fn create_module_33() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -498,8 +843,19 @@ fn create_module_33() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_33(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 119 + +#[test] +fn test_module_33() { + let result_object = create_module_33(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_33(&result_object, &vm_context); +} fn create_module_34() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -508,8 +864,19 @@ fn create_module_34() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_34(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 120 + +#[test] +fn test_module_34() { + let result_object = create_module_34(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_34(&result_object, &vm_context); +} fn create_module_35() -> ResultObject { let module_str = "(module (table (;0;) 0 anyfunc) @@ -518,8 +885,19 @@ fn create_module_35() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_35(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 121 + +#[test] +fn test_module_35() { + let result_object = create_module_35(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_35(&result_object, &vm_context); +} fn create_module_36() -> ResultObject { let module_str = "(module (table (;0;) 0 1 anyfunc) @@ -528,6 +906,9 @@ fn create_module_36() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_36(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 126 #[test] @@ -570,6 +951,14 @@ fn c56_l147_assert_invalid() { } // Line 154 + +#[test] +fn test_module_36() { + let result_object = create_module_36(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_36(&result_object, &vm_context); +} fn create_module_37() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -578,8 +967,19 @@ fn create_module_37() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_37(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 155 + +#[test] +fn test_module_37() { + let result_object = create_module_37(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_37(&result_object, &vm_context); +} fn create_module_38() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -589,8 +989,19 @@ fn create_module_38() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_38(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 159 + +#[test] +fn test_module_38() { + let result_object = create_module_38(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_38(&result_object, &vm_context); +} fn create_module_39() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -599,8 +1010,19 @@ fn create_module_39() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_39(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 160 + +#[test] +fn test_module_39() { + let result_object = create_module_39(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_39(&result_object, &vm_context); +} fn create_module_40() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -609,8 +1031,19 @@ fn create_module_40() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_40(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 161 + +#[test] +fn test_module_40() { + let result_object = create_module_40(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_40(&result_object, &vm_context); +} fn create_module_41() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -619,8 +1052,19 @@ fn create_module_41() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_41(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 162 + +#[test] +fn test_module_41() { + let result_object = create_module_41(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_41(&result_object, &vm_context); +} fn create_module_42() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -629,8 +1073,19 @@ fn create_module_42() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_42(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 163 + +#[test] +fn test_module_42() { + let result_object = create_module_42(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_42(&result_object, &vm_context); +} fn create_module_43() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -639,8 +1094,19 @@ fn create_module_43() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_43(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 164 + +#[test] +fn test_module_43() { + let result_object = create_module_43(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_43(&result_object, &vm_context); +} fn create_module_44() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -649,8 +1115,19 @@ fn create_module_44() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_44(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 165 + +#[test] +fn test_module_44() { + let result_object = create_module_44(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_44(&result_object, &vm_context); +} fn create_module_45() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -659,8 +1136,19 @@ fn create_module_45() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_45(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 166 + +#[test] +fn test_module_45() { + let result_object = create_module_45(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_45(&result_object, &vm_context); +} fn create_module_46() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -669,8 +1157,19 @@ fn create_module_46() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_46(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 167 + +#[test] +fn test_module_46() { + let result_object = create_module_46(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_46(&result_object, &vm_context); +} fn create_module_47() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -679,8 +1178,19 @@ fn create_module_47() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_47(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 168 + +#[test] +fn test_module_47() { + let result_object = create_module_47(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_47(&result_object, &vm_context); +} fn create_module_48() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -689,8 +1199,19 @@ fn create_module_48() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_48(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 169 + +#[test] +fn test_module_48() { + let result_object = create_module_48(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_48(&result_object, &vm_context); +} fn create_module_49() -> ResultObject { let module_str = "(module (memory (;0;) 0) @@ -699,8 +1220,19 @@ fn create_module_49() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_49(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 170 + +#[test] +fn test_module_49() { + let result_object = create_module_49(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_49(&result_object, &vm_context); +} fn create_module_50() -> ResultObject { let module_str = "(module (memory (;0;) 0 1) @@ -709,6 +1241,9 @@ fn create_module_50() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_50(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 175 #[test] @@ -749,3 +1284,11 @@ fn c75_l196_assert_invalid() { let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } + +#[test] +fn test_module_50() { + let result_object = create_module_50(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_50(&result_object, &vm_context); +} diff --git a/src/spectests/f32_.rs b/src/spectests/f32_.rs index bba903ad8..2efca8b0e 100644 --- a/src/spectests/f32_.rs +++ b/src/spectests/f32_.rs @@ -69,6 +69,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 19 fn c1_l19_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -20965,6 +20968,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l19_action_invoke(&result_object, &vm_context); c2_l20_action_invoke(&result_object, &vm_context); c3_l21_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/f32_bitwise.rs b/src/spectests/f32_bitwise.rs index db398c4d0..9525f1f6c 100644 --- a/src/spectests/f32_bitwise.rs +++ b/src/spectests/f32_bitwise.rs @@ -32,6 +32,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 10 fn c1_l10_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -4398,6 +4401,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l10_action_invoke(&result_object, &vm_context); c2_l11_action_invoke(&result_object, &vm_context); c3_l12_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/f32_cmp.rs b/src/spectests/f32_cmp.rs index b5c9780ba..28c22c4d4 100644 --- a/src/spectests/f32_cmp.rs +++ b/src/spectests/f32_cmp.rs @@ -48,6 +48,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 13 fn c1_l13_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -28854,6 +28857,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l13_action_invoke(&result_object, &vm_context); c2_l14_action_invoke(&result_object, &vm_context); c3_l15_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/f64_.rs b/src/spectests/f64_.rs index 44e8d2ef8..0a158b205 100644 --- a/src/spectests/f64_.rs +++ b/src/spectests/f64_.rs @@ -69,6 +69,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 19 fn c1_l19_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -20965,6 +20968,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l19_action_invoke(&result_object, &vm_context); c2_l20_action_invoke(&result_object, &vm_context); c3_l21_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/f64_bitwise.rs b/src/spectests/f64_bitwise.rs index 319f010d9..ca42b098d 100644 --- a/src/spectests/f64_bitwise.rs +++ b/src/spectests/f64_bitwise.rs @@ -32,6 +32,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 10 fn c1_l10_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -4398,6 +4401,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l10_action_invoke(&result_object, &vm_context); c2_l11_action_invoke(&result_object, &vm_context); c3_l12_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/f64_cmp.rs b/src/spectests/f64_cmp.rs index ac42fbd89..460f311cd 100644 --- a/src/spectests/f64_cmp.rs +++ b/src/spectests/f64_cmp.rs @@ -48,6 +48,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 13 fn c1_l13_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -28854,6 +28857,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l13_action_invoke(&result_object, &vm_context); c2_l14_action_invoke(&result_object, &vm_context); c3_l15_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/float_literals.rs b/src/spectests/float_literals.rs index e516c2bd5..f8ec5d212 100644 --- a/src/spectests/float_literals.rs +++ b/src/spectests/float_literals.rs @@ -329,6 +329,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 105 fn c1_l105_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1321,6 +1324,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l105_action_invoke(&result_object, &vm_context); c2_l106_action_invoke(&result_object, &vm_context); c3_l107_action_invoke(&result_object, &vm_context); @@ -1414,6 +1418,9 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 201 fn c84_l201_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2040,5 +2047,6 @@ fn test_module_2() { let result_object = create_module_2(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_2(&result_object, &vm_context); c84_l201_action_invoke(&result_object, &vm_context); } diff --git a/src/spectests/func_ptrs.rs b/src/spectests/func_ptrs.rs index d83cad00a..3857cf1f9 100644 --- a/src/spectests/func_ptrs.rs +++ b/src/spectests/func_ptrs.rs @@ -44,6 +44,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 27 fn c1_l27_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -156,6 +159,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l27_action_invoke(&result_object, &vm_context); c2_l28_action_invoke(&result_object, &vm_context); c3_l29_action_invoke(&result_object, &vm_context); @@ -190,6 +194,9 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 71 fn c13_l71_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -378,6 +385,7 @@ fn test_module_2() { let result_object = create_module_2(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_2(&result_object, &vm_context); c13_l71_action_invoke(&result_object, &vm_context); c14_l72_action_invoke(&result_object, &vm_context); c15_l73_action_invoke(&result_object, &vm_context); @@ -411,6 +419,9 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 105 fn c34_l105_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -441,6 +452,7 @@ fn test_module_3() { let result_object = create_module_3(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_3(&result_object, &vm_context); c34_l105_action_invoke(&result_object, &vm_context); c35_l106_action_invoke(&result_object, &vm_context); } diff --git a/src/spectests/get_local.rs b/src/spectests/get_local.rs index 957ee9c00..e73d73af3 100644 --- a/src/spectests/get_local.rs +++ b/src/spectests/get_local.rs @@ -118,6 +118,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 64 fn c1_l64_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -340,6 +343,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l64_action_invoke(&result_object, &vm_context); c2_l65_action_invoke(&result_object, &vm_context); c3_l66_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/globals.rs b/src/spectests/globals.rs index 0a4fdeb67..adbc71df2 100644 --- a/src/spectests/globals.rs +++ b/src/spectests/globals.rs @@ -269,6 +269,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 182 fn c1_l182_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -808,13 +811,110 @@ fn c46_l245_assert_invalid() { assert!(compilation.is_err(), "WASM should not compile as is invalid"); } -// Line 250 +// Line 257 +#[test] +fn c47_l257_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 10, 1, 125, 0, 67, 0, 0, 0, 0, 140, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 262 +#[test] +fn c48_l262_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 6, 1, 125, 0, 32, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 267 +#[test] +fn c49_l267_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 10, 1, 125, 0, 67, 0, 0, 128, 63, 140, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 272 +#[test] +fn c50_l272_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 7, 1, 127, 0, 65, 0, 1, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 277 +#[test] +fn c51_l277_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 5, 1, 127, 0, 1, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 282 +#[test] +fn c52_l282_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 9, 1, 127, 0, 67, 0, 0, 0, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 287 +#[test] +fn c53_l287_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 8, 1, 127, 0, 65, 0, 65, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 292 +#[test] +fn c54_l292_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 4, 1, 127, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 297 +#[test] +fn c55_l297_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 6, 1, 127, 0, 35, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 302 +#[test] +fn c56_l302_assert_invalid() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 11, 2, 127, 0, 35, 1, 11, 127, 0, 65, 0, 11]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is invalid"); +} + +// Line 312 +#[test] +fn c57_l312_assert_malformed() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 2, 148, 128, 128, 128, 0, 1, 8, 115, 112, 101, 99, 116, 101, 115, 116, 10, 103, 108, 111, 98, 97, 108, 95, 105, 51, 50, 3, 127, 2]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is malformed"); +} + +// Line 325 +#[test] +fn c58_l325_assert_malformed() { + let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 2, 148, 128, 128, 128, 0, 1, 8, 115, 112, 101, 99, 116, 101, 115, 116, 10, 103, 108, 111, 98, 97, 108, 95, 105, 51, 50, 3, 127, 255]; + let compilation = compile(wasm_binary.to_vec()); + assert!(compilation.is_err(), "WASM should not compile as is malformed"); +} + +// Line 338 #[test] fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l182_action_invoke(&result_object, &vm_context); c2_l183_action_invoke(&result_object, &vm_context); c3_l184_action_invoke(&result_object, &vm_context); @@ -861,150 +961,36 @@ fn test_module_1() { c45_l242_action_invoke(&result_object, &vm_context); } fn create_module_2() -> ResultObject { - let module_str = "(module - (global (;0;) (mut f32) (f32.const 0x0p+0 (;=0;))) - (export \"a\" (global 0))) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 251 -fn create_module_3() -> ResultObject { - let module_str = "(module - (global (;0;) (mut f32) (f32.const 0x0p+0 (;=0;))) - (export \"a\" (global 0))) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 254 -#[test] -fn c49_l254_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 10, 1, 125, 0, 67, 0, 0, 0, 0, 140, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 259 -#[test] -fn c50_l259_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 6, 1, 125, 0, 32, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 264 -#[test] -fn c51_l264_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 10, 1, 125, 0, 67, 0, 0, 128, 63, 140, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 269 -#[test] -fn c52_l269_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 7, 1, 127, 0, 65, 0, 1, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 274 -#[test] -fn c53_l274_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 5, 1, 127, 0, 1, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 279 -#[test] -fn c54_l279_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 9, 1, 127, 0, 67, 0, 0, 0, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 284 -#[test] -fn c55_l284_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 8, 1, 127, 0, 65, 0, 65, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 289 -#[test] -fn c56_l289_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 4, 1, 127, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 294 -#[test] -fn c57_l294_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 6, 1, 127, 0, 35, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 299 -#[test] -fn c58_l299_assert_invalid() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 11, 2, 127, 0, 35, 1, 11, 127, 0, 65, 0, 11]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is invalid"); -} - -// Line 303 -fn create_module_4() -> ResultObject { - let module_str = "(module - (import \"spectest\" \"global_i32\" (global (;0;) i32))) - "; - let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); - instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") -} - -// Line 307 -#[test] -fn c60_l307_assert_malformed() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 2, 148, 128, 128, 128, 0, 1, 8, 115, 112, 101, 99, 116, 101, 115, 116, 10, 103, 108, 111, 98, 97, 108, 95, 105, 51, 50, 3, 127, 2]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is malformed"); -} - -// Line 320 -#[test] -fn c61_l320_assert_malformed() { - let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 2, 148, 128, 128, 128, 0, 1, 8, 115, 112, 101, 99, 116, 101, 115, 116, 10, 103, 108, 111, 98, 97, 108, 95, 105, 51, 50, 3, 127, 255]; - let compilation = compile(wasm_binary.to_vec()); - assert!(compilation.is_err(), "WASM should not compile as is malformed"); -} - -// Line 333 -fn create_module_5() -> ResultObject { let module_str = "(module (global (;0;) i32 (i32.const 0))) "; let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} -// Line 337 +// Line 342 #[test] -fn c63_l337_assert_malformed() { +fn c60_l342_assert_malformed() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 134, 128, 128, 128, 0, 1, 127, 2, 65, 0, 11]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is malformed"); } -// Line 349 +// Line 354 #[test] -fn c64_l349_assert_malformed() { +fn c61_l354_assert_malformed() { let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 6, 134, 128, 128, 128, 0, 1, 127, 255, 65, 0, 11]; let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is malformed"); } + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} diff --git a/src/spectests/i32_.rs b/src/spectests/i32_.rs index 285c1c459..5663e7018 100644 --- a/src/spectests/i32_.rs +++ b/src/spectests/i32_.rs @@ -160,6 +160,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 35 fn c1_l35_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -4384,6 +4387,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l35_action_invoke(&result_object, &vm_context); c2_l36_action_invoke(&result_object, &vm_context); c3_l37_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/i64_.rs b/src/spectests/i64_.rs index 539e0cc58..04a3b38ea 100644 --- a/src/spectests/i64_.rs +++ b/src/spectests/i64_.rs @@ -162,6 +162,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 35 fn c1_l35_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -4386,6 +4389,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l35_action_invoke(&result_object, &vm_context); c2_l36_action_invoke(&result_object, &vm_context); c3_l37_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/if_.rs b/src/spectests/if_.rs index 6f9f9295b..440589f3a 100644 --- a/src/spectests/if_.rs +++ b/src/spectests/if_.rs @@ -635,6 +635,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 384 fn c1_l384_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2015,6 +2018,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l384_action_invoke(&result_object, &vm_context); c2_l385_action_invoke(&result_object, &vm_context); c3_l386_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/labels.rs b/src/spectests/labels.rs index 40a8abc1a..2deea1fe8 100644 --- a/src/spectests/labels.rs +++ b/src/spectests/labels.rs @@ -451,6 +451,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 284 fn c1_l284_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -781,6 +784,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l284_action_invoke(&result_object, &vm_context); c2_l285_action_invoke(&result_object, &vm_context); c3_l286_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/left_to_right.rs b/src/spectests/left_to_right.rs index b3382981f..d0638c8a3 100644 --- a/src/spectests/left_to_right.rs +++ b/src/spectests/left_to_right.rs @@ -959,6 +959,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 181 fn c1_l181_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -2105,6 +2108,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l181_action_invoke(&result_object, &vm_context); c2_l181_action_invoke(&result_object, &vm_context); c3_l182_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/loop_.rs b/src/spectests/loop_.rs index 85eedd72b..7dfbfe6f8 100644 --- a/src/spectests/loop_.rs +++ b/src/spectests/loop_.rs @@ -667,6 +667,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 305 fn c1_l305_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1541,6 +1544,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l305_action_invoke(&result_object, &vm_context); c2_l306_action_invoke(&result_object, &vm_context); c3_l307_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/memory.rs b/src/spectests/memory.rs index 6f81b63fd..17b58bb7a 100644 --- a/src/spectests/memory.rs +++ b/src/spectests/memory.rs @@ -18,8 +18,19 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 3 + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} fn create_module_2() -> ResultObject { let module_str = "(module (memory (;0;) 0 1)) @@ -27,8 +38,19 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 4 + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} fn create_module_3() -> ResultObject { let module_str = "(module (memory (;0;) 1 256)) @@ -36,8 +58,19 @@ fn create_module_3() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 5 + +#[test] +fn test_module_3() { + let result_object = create_module_3(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_3(&result_object, &vm_context); +} fn create_module_4() -> ResultObject { let module_str = "(module (memory (;0;) 0 65536)) @@ -45,6 +78,9 @@ fn create_module_4() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 7 #[test] @@ -63,6 +99,14 @@ fn c5_l8_assert_invalid() { } // Line 10 + +#[test] +fn test_module_4() { + let result_object = create_module_4(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_4(&result_object, &vm_context); +} fn create_module_5() -> ResultObject { let module_str = "(module (type (;0;) (func (result i32))) @@ -75,6 +119,9 @@ fn create_module_5() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_5(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 11 fn c7_l11_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -95,6 +142,7 @@ fn test_module_5() { let result_object = create_module_5(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_5(&result_object, &vm_context); c7_l11_action_invoke(&result_object, &vm_context); } fn create_module_6() -> ResultObject { @@ -109,6 +157,9 @@ fn create_module_6() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_6(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 13 fn c9_l13_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -129,6 +180,7 @@ fn test_module_6() { let result_object = create_module_6(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_6(&result_object, &vm_context); c9_l13_action_invoke(&result_object, &vm_context); } fn create_module_7() -> ResultObject { @@ -143,6 +195,9 @@ fn create_module_7() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 15 fn c11_l15_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -289,5 +344,6 @@ fn test_module_7() { let result_object = create_module_7(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_7(&result_object, &vm_context); c11_l15_action_invoke(&result_object, &vm_context); } diff --git a/src/spectests/memory_redundancy.rs b/src/spectests/memory_redundancy.rs index 5b41225a2..595dcc522 100644 --- a/src/spectests/memory_redundancy.rs +++ b/src/spectests/memory_redundancy.rs @@ -94,6 +94,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 59 fn c1_l59_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -184,6 +187,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l59_action_invoke(&result_object, &vm_context); c2_l60_action_invoke(&result_object, &vm_context); c3_l61_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/return_.rs b/src/spectests/return_.rs index 5c08672ec..5e70e5f69 100644 --- a/src/spectests/return_.rs +++ b/src/spectests/return_.rs @@ -412,6 +412,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 217 fn c1_l217_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -1174,6 +1177,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l217_action_invoke(&result_object, &vm_context); c2_l218_action_invoke(&result_object, &vm_context); c3_l219_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/select.rs b/src/spectests/select.rs index c71795062..6d40718cc 100644 --- a/src/spectests/select.rs +++ b/src/spectests/select.rs @@ -75,6 +75,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 31 fn c1_l31_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -393,6 +396,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l31_action_invoke(&result_object, &vm_context); c2_l32_action_invoke(&result_object, &vm_context); c3_l33_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/set_local.rs b/src/spectests/set_local.rs index c82f22c96..c0d7f5a3e 100644 --- a/src/spectests/set_local.rs +++ b/src/spectests/set_local.rs @@ -121,6 +121,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 68 fn c1_l68_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -431,6 +434,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l68_action_invoke(&result_object, &vm_context); c2_l69_action_invoke(&result_object, &vm_context); c3_l70_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/stack.rs b/src/spectests/stack.rs index 928880df2..22afe71de 100644 --- a/src/spectests/stack.rs +++ b/src/spectests/stack.rs @@ -158,6 +158,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 130 fn c1_l130_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -202,6 +205,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l130_action_invoke(&result_object, &vm_context); c2_l131_action_invoke(&result_object, &vm_context); c3_l132_action_invoke(&result_object, &vm_context); @@ -435,3 +439,14 @@ fn create_module_2() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} + +#[test] +fn test_module_2() { + let result_object = create_module_2(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_2(&result_object, &vm_context); +} diff --git a/src/spectests/switch.rs b/src/spectests/switch.rs index bbca41762..627c96912 100644 --- a/src/spectests/switch.rs +++ b/src/spectests/switch.rs @@ -137,6 +137,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 120 fn c1_l120_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -463,6 +466,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l120_action_invoke(&result_object, &vm_context); c2_l121_action_invoke(&result_object, &vm_context); c3_l122_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/tee_local.rs b/src/spectests/tee_local.rs index df09ed31e..b6cc2ae9c 100644 --- a/src/spectests/tee_local.rs +++ b/src/spectests/tee_local.rs @@ -185,6 +185,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 98 fn c1_l98_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) { @@ -507,6 +510,7 @@ fn test_module_1() { let result_object = create_module_1(); let vm_context = result_object.instance.generate_context(); // We group the calls together + start_module_1(&result_object, &vm_context); c1_l98_action_invoke(&result_object, &vm_context); c2_l99_action_invoke(&result_object, &vm_context); c3_l100_action_invoke(&result_object, &vm_context); diff --git a/src/spectests/types.rs b/src/spectests/types.rs index 0d83261b3..c09d54077 100644 --- a/src/spectests/types.rs +++ b/src/spectests/types.rs @@ -31,6 +31,9 @@ fn create_module_1() -> ResultObject { let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed"); instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated") } +fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) { + result_object.instance.start(&vm_context); +} // Line 44 #[test] @@ -63,3 +66,11 @@ fn c4_l57_assert_invalid() { let compilation = compile(wasm_binary.to_vec()); assert!(compilation.is_err(), "WASM should not compile as is invalid"); } + +#[test] +fn test_module_1() { + let result_object = create_module_1(); + let vm_context = result_object.instance.generate_context(); + // We group the calls together + start_module_1(&result_object, &vm_context); +} diff --git a/src/webassembly/instance.rs b/src/webassembly/instance.rs index 722dd9507..463574317 100644 --- a/src/webassembly/instance.rs +++ b/src/webassembly/instance.rs @@ -333,8 +333,9 @@ impl Instance { } for init in &module.info.data_initializers { debug_assert!(init.base.is_none(), "globalvar base not supported yet"); + let mut offset = init.offset; let mem_mut = memories[init.memory_index].as_mut(); - let to_init = &mut mem_mut[init.offset..init.offset + init.data.len()]; + let to_init = &mut mem_mut[offset..offset + init.data.len()]; to_init.copy_from_slice(&init.data); } } @@ -357,7 +358,16 @@ impl Instance { GlobalInit::I64Const(n) => n, GlobalInit::F32Const(f) => f as _, // unsafe { mem::transmute(f as f64) }, GlobalInit::F64Const(f) => f as _, // unsafe { mem::transmute(f) }, - _ => unimplemented!(), + GlobalInit::GlobalRef(global_index) => { + unimplemented!("GlobalInit::GlobalRef is not yet supported") + } + GlobalInit::Import() => { + // Right now (because there is no module/field fields on the Import + // https://github.com/CraneStation/cranelift/blob/5cabce9b58ff960534d4017fad11f2e78c72ceab/lib/wasm/src/sections_translator.rs#L90-L99 ) + // It's impossible to know where to take the global from. + // This should be fixed in Cranelift itself. + unimplemented!("GlobalInit::Import is not yet supported") + } }; globals_data[i] = value; } diff --git a/src/webassembly/module.rs b/src/webassembly/module.rs index 1dbd3260a..c40f62cf9 100644 --- a/src/webassembly/module.rs +++ b/src/webassembly/module.rs @@ -734,8 +734,6 @@ impl<'data> ModuleEnvironment<'data> for Module { offset: usize, data: &'data [u8], ) { - debug_assert!(base.is_none(), "global-value offsets not supported yet"); - // debug!("DATA INITIALIZATION {:?} {:?}", memory_index, base); self.info.data_initializers.push(DataInitializer { memory_index, base,