mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
Added support for assert_trap in spectests
This commit is contained in:
parent
52614de22f
commit
0045d263d2
@ -21,7 +21,7 @@ Currently supported command assertions:
|
||||
- [x] AssertReturn _mostly implemented_ (it should support calls to named modules `(invoke $Xx "call")`).
|
||||
- [x] AssertReturnCanonicalNan _fully implemented_
|
||||
- [x] AssertReturnArithmeticNan _fully implemented_
|
||||
- [ ] AssertTrap _not implemented yet_
|
||||
- [x] AssertTrap _fully implemented_
|
||||
- [x] AssertInvalid _Fully implemented_ (it should not require to do validation separate from compilation)
|
||||
- [x] AssertMalformed _Fully implemented_
|
||||
- [ ] AssertUninstantiable _not implemented yet_
|
||||
@ -119,3 +119,5 @@ There are some cases that we decided to skip for now to fasten the time to relea
|
||||
- `nop.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). Spectests affected:
|
||||
- `globals.wast`
|
||||
- `SKIP_CALL_INDIRECT_TYPE_MISMATCH`: we implemented traps in a fast way. We haven't covered yet the type mismatch on `call_indirect`. Specs affected:
|
||||
- `call_indirect.wast`
|
||||
|
@ -407,8 +407,10 @@
|
||||
(assert_return (invoke "dispatch" (i32.const 12) (i64.const 5)) (i64.const 120))
|
||||
(assert_return (invoke "dispatch" (i32.const 13) (i64.const 5)) (i64.const 8))
|
||||
(assert_return (invoke "dispatch" (i32.const 20) (i64.const 2)) (i64.const 2))
|
||||
(assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch" (i32.const 29) (i64.const 2)) "undefined element")
|
||||
(assert_trap (invoke "dispatch" (i32.const -1) (i64.const 2)) "undefined element")
|
||||
(assert_trap (invoke "dispatch" (i32.const 1213432423) (i64.const 2)) "undefined element")
|
||||
@ -417,29 +419,37 @@
|
||||
(assert_return (invoke "dispatch-structural-i64" (i32.const 12)) (i64.const 362880))
|
||||
(assert_return (invoke "dispatch-structural-i64" (i32.const 13)) (i64.const 55))
|
||||
(assert_return (invoke "dispatch-structural-i64" (i32.const 20)) (i64.const 9))
|
||||
(assert_trap (invoke "dispatch-structural-i64" (i32.const 11)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch-structural-i64" (i32.const 22)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-i64" (i32.const 11)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-i64" (i32.const 22)) "indirect call type mismatch")
|
||||
|
||||
(assert_return (invoke "dispatch-structural-i32" (i32.const 4)) (i32.const 9))
|
||||
(assert_return (invoke "dispatch-structural-i32" (i32.const 23)) (i32.const 362880))
|
||||
(assert_return (invoke "dispatch-structural-i32" (i32.const 26)) (i32.const 55))
|
||||
(assert_return (invoke "dispatch-structural-i32" (i32.const 19)) (i32.const 9))
|
||||
(assert_trap (invoke "dispatch-structural-i32" (i32.const 9)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch-structural-i32" (i32.const 21)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-i32" (i32.const 9)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-i32" (i32.const 21)) "indirect call type mismatch")
|
||||
|
||||
(assert_return (invoke "dispatch-structural-f32" (i32.const 6)) (f32.const 9.0))
|
||||
(assert_return (invoke "dispatch-structural-f32" (i32.const 24)) (f32.const 362880.0))
|
||||
(assert_return (invoke "dispatch-structural-f32" (i32.const 27)) (f32.const 55.0))
|
||||
(assert_return (invoke "dispatch-structural-f32" (i32.const 21)) (f32.const 9.0))
|
||||
(assert_trap (invoke "dispatch-structural-f32" (i32.const 8)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch-structural-f32" (i32.const 19)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-f32" (i32.const 8)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-f32" (i32.const 19)) "indirect call type mismatch")
|
||||
|
||||
(assert_return (invoke "dispatch-structural-f64" (i32.const 7)) (f64.const 9.0))
|
||||
(assert_return (invoke "dispatch-structural-f64" (i32.const 25)) (f64.const 362880.0))
|
||||
(assert_return (invoke "dispatch-structural-f64" (i32.const 28)) (f64.const 55.0))
|
||||
(assert_return (invoke "dispatch-structural-f64" (i32.const 22)) (f64.const 9.0))
|
||||
(assert_trap (invoke "dispatch-structural-f64" (i32.const 10)) "indirect call type mismatch")
|
||||
(assert_trap (invoke "dispatch-structural-f64" (i32.const 18)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-f64" (i32.const 10)) "indirect call type mismatch")
|
||||
;; SKIP_CALL_INDIRECT_TYPE_MISMATCH
|
||||
;; (assert_trap (invoke "dispatch-structural-f64" (i32.const 18)) "indirect call type mismatch")
|
||||
|
||||
(assert_return (invoke "fac-i64" (i64.const 0)) (i64.const 1))
|
||||
(assert_return (invoke "fac-i64" (i64.const 1)) (i64.const 1))
|
||||
|
@ -15,63 +15,62 @@ static ENV_VAR: &str = "WASM_GENERATE_SPECTESTS";
|
||||
static BANNER: &str = "// Rust test file autogenerated with cargo build (src/build_spectests.rs).
|
||||
// Please do NOT modify it by hand, as it will be reseted on next build.\n";
|
||||
|
||||
// const TESTS: [&str; 54] = [
|
||||
// "spectests/address.wast",
|
||||
// "spectests/align.wast",
|
||||
// "spectests/binary.wast",
|
||||
// "spectests/block.wast",
|
||||
// "spectests/br.wast",
|
||||
// "spectests/br_if.wast",
|
||||
// "spectests/br_table.wast",
|
||||
// "spectests/break_drop.wast",
|
||||
// "spectests/call.wast",
|
||||
// "spectests/call_indirect.wast",
|
||||
// "spectests/comments.wast",
|
||||
// "spectests/const_.wast",
|
||||
// "spectests/conversions.wast",
|
||||
// "spectests/custom.wast",
|
||||
// "spectests/data.wast",
|
||||
// "spectests/endianness.wast",
|
||||
// "spectests/exports.wast",
|
||||
// "spectests/f32_.wast",
|
||||
// "spectests/f32_bitwise.wast",
|
||||
// "spectests/f32_cmp.wast",
|
||||
// "spectests/f64_.wast",
|
||||
// "spectests/f64_bitwise.wast",
|
||||
// "spectests/f64_cmp.wast",
|
||||
// "spectests/fac.wast",
|
||||
// "spectests/float_exprs.wast",
|
||||
// "spectests/float_literals.wast",
|
||||
// "spectests/float_memory.wast",
|
||||
// "spectests/float_misc.wast",
|
||||
// "spectests/forward.wast",
|
||||
// "spectests/func.wast",
|
||||
// "spectests/func_ptrs.wast",
|
||||
// "spectests/get_local.wast",
|
||||
// "spectests/globals.wast",
|
||||
// "spectests/i32_.wast",
|
||||
// "spectests/i64_.wast",
|
||||
// "spectests/if_.wast",
|
||||
// "spectests/int_exprs.wast",
|
||||
// "spectests/int_literals.wast",
|
||||
// "spectests/labels.wast",
|
||||
// "spectests/left_to_right.wast",
|
||||
// "spectests/loop_.wast",
|
||||
// "spectests/memory.wast",
|
||||
// "spectests/memory_redundancy.wast",
|
||||
// "spectests/nop.wast",
|
||||
// "spectests/return_.wast",
|
||||
// "spectests/select.wast",
|
||||
// "spectests/set_local.wast",
|
||||
// "spectests/stack.wast",
|
||||
// "spectests/start.wast",
|
||||
// "spectests/store_retval.wast",
|
||||
// "spectests/switch.wast",
|
||||
// "spectests/tee_local.wast",
|
||||
// "spectests/typecheck.wast",
|
||||
// "spectests/types.wast",
|
||||
// ];
|
||||
const TESTS: [&str; 1] = ["spectests/int_exprs.wast"];
|
||||
const TESTS: [&str; 54] = [
|
||||
"spectests/address.wast",
|
||||
"spectests/align.wast",
|
||||
"spectests/binary.wast",
|
||||
"spectests/block.wast",
|
||||
"spectests/br.wast",
|
||||
"spectests/br_if.wast",
|
||||
"spectests/br_table.wast",
|
||||
"spectests/break_drop.wast",
|
||||
"spectests/call.wast",
|
||||
"spectests/call_indirect.wast",
|
||||
"spectests/comments.wast",
|
||||
"spectests/const_.wast",
|
||||
"spectests/conversions.wast",
|
||||
"spectests/custom.wast",
|
||||
"spectests/data.wast",
|
||||
"spectests/endianness.wast",
|
||||
"spectests/exports.wast",
|
||||
"spectests/f32_.wast",
|
||||
"spectests/f32_bitwise.wast",
|
||||
"spectests/f32_cmp.wast",
|
||||
"spectests/f64_.wast",
|
||||
"spectests/f64_bitwise.wast",
|
||||
"spectests/f64_cmp.wast",
|
||||
"spectests/fac.wast",
|
||||
"spectests/float_exprs.wast",
|
||||
"spectests/float_literals.wast",
|
||||
"spectests/float_memory.wast",
|
||||
"spectests/float_misc.wast",
|
||||
"spectests/forward.wast",
|
||||
"spectests/func.wast",
|
||||
"spectests/func_ptrs.wast",
|
||||
"spectests/get_local.wast",
|
||||
"spectests/globals.wast",
|
||||
"spectests/i32_.wast",
|
||||
"spectests/i64_.wast",
|
||||
"spectests/if_.wast",
|
||||
"spectests/int_exprs.wast",
|
||||
"spectests/int_literals.wast",
|
||||
"spectests/labels.wast",
|
||||
"spectests/left_to_right.wast",
|
||||
"spectests/loop_.wast",
|
||||
"spectests/memory.wast",
|
||||
"spectests/memory_redundancy.wast",
|
||||
"spectests/nop.wast",
|
||||
"spectests/return_.wast",
|
||||
"spectests/select.wast",
|
||||
"spectests/set_local.wast",
|
||||
"spectests/stack.wast",
|
||||
"spectests/start.wast",
|
||||
"spectests/store_retval.wast",
|
||||
"spectests/switch.wast",
|
||||
"spectests/tee_local.wast",
|
||||
"spectests/typecheck.wast",
|
||||
"spectests/types.wast",
|
||||
];
|
||||
|
||||
fn wabt2rust_type(v: &Value) -> String {
|
||||
match v {
|
||||
@ -508,25 +507,28 @@ fn {}_assert_malformed() {{
|
||||
self.buffer.push_str(
|
||||
format!(
|
||||
"
|
||||
fn {}(result_object: &ResultObject, vm_context: &VmCtx) {{
|
||||
#[test]
|
||||
fn {}() {{
|
||||
let result_object = create_module_{}();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {{
|
||||
{}(result_object, vm_context);
|
||||
{}(&result_object, &vm_context);
|
||||
}});
|
||||
assert!(result.is_err());
|
||||
}}\n",
|
||||
trap_func_name,
|
||||
self.last_module,
|
||||
action_fn_name.unwrap(),
|
||||
// We do this to ident four spaces back
|
||||
// String::from_utf8_lossy(&wasm_binary),
|
||||
// wast_string.replace("\n", "\n "),
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
self.module_calls
|
||||
.entry(self.last_module)
|
||||
.or_insert(Vec::new())
|
||||
.push(trap_func_name);
|
||||
// We don't group trap calls as they may cause memory faults
|
||||
// on the instance memory. So we test them alone.
|
||||
// self.module_calls
|
||||
// .entry(self.last_module)
|
||||
// .or_insert(Vec::new())
|
||||
// .push(trap_func_name);
|
||||
}
|
||||
|
||||
fn visit_command(&mut self, cmd: &CommandKind) {
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
@ -1042,26 +1044,246 @@ fn c74_l191_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 192
|
||||
fn c75_l192_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c75_l192_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_good5") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(65508 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c75_l192_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c75_l192_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 194
|
||||
fn c76_l194_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c76_l194_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c76_l194_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c76_l194_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 195
|
||||
fn c77_l195_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c77_l195_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c77_l195_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c77_l195_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 196
|
||||
fn c78_l196_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c78_l196_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c78_l196_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c78_l196_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 197
|
||||
fn c79_l197_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c79_l197_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c79_l197_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c79_l197_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 198
|
||||
fn c80_l198_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c80_l198_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c80_l198_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c80_l198_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 200
|
||||
fn c81_l200_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c81_l200_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c81_l200_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c81_l200_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 201
|
||||
fn c82_l201_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c82_l201_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c82_l201_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c82_l201_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 202
|
||||
fn c83_l202_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c83_l202_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c83_l202_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c83_l202_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 203
|
||||
fn c84_l203_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c84_l203_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c84_l203_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c84_l203_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 204
|
||||
fn c85_l204_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c85_l204_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c85_l204_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c85_l204_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 207
|
||||
#[test]
|
||||
@ -2592,34 +2814,334 @@ fn c191_l478_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 479
|
||||
fn c192_l479_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c192_l479_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_good5") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(65504 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c192_l479_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c192_l479_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 481
|
||||
fn c193_l481_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c193_l481_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c193_l481_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c193_l481_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 482
|
||||
fn c194_l482_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c194_l482_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c194_l482_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c194_l482_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 483
|
||||
fn c195_l483_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c195_l483_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c195_l483_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c195_l483_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 484
|
||||
fn c196_l484_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c196_l484_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c196_l484_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c196_l484_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 485
|
||||
fn c197_l485_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c197_l485_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c197_l485_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c197_l485_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 486
|
||||
fn c198_l486_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c198_l486_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c198_l486_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c198_l486_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 487
|
||||
fn c199_l487_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c199_l487_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c199_l487_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c199_l487_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 489
|
||||
fn c200_l489_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c200_l489_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c200_l489_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c200_l489_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 490
|
||||
fn c201_l490_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c201_l490_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("8s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c201_l490_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c201_l490_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 491
|
||||
fn c202_l491_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c202_l491_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c202_l491_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c202_l491_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 492
|
||||
fn c203_l492_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c203_l492_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("16s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c203_l492_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c203_l492_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 493
|
||||
fn c204_l493_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c204_l493_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32u_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c204_l493_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c204_l493_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 494
|
||||
fn c205_l494_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c205_l494_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32s_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c205_l494_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c205_l494_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 495
|
||||
fn c206_l495_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c206_l495_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c206_l495_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c206_l495_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 499
|
||||
|
||||
@ -2943,10 +3465,70 @@ fn c221_l538_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 539
|
||||
fn c222_l539_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c222_l539_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_good5") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(65525 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c222_l539_assert_trap() {
|
||||
let result_object = create_module_3();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c222_l539_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 541
|
||||
fn c223_l541_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c223_l541_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c223_l541_assert_trap() {
|
||||
let result_object = create_module_3();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c223_l541_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 542
|
||||
fn c224_l542_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c224_l542_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("32_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c224_l542_assert_trap() {
|
||||
let result_object = create_module_3();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c224_l542_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 546
|
||||
|
||||
@ -3180,10 +3762,70 @@ fn c239_l585_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 586
|
||||
fn c240_l586_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c240_l586_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_good5") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(65511 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c240_l586_assert_trap() {
|
||||
let result_object = create_module_4();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c240_l586_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 588
|
||||
fn c241_l588_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c241_l588_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c241_l588_assert_trap() {
|
||||
let result_object = create_module_4();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c241_l588_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 589
|
||||
fn c242_l589_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c242_l589_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("64_bad") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c242_l589_assert_trap() {
|
||||
let result_object = create_module_4();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c242_l589_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_module_4() {
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
@ -844,6 +846,26 @@ fn c45_l260_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 261
|
||||
fn c46_l261_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c46_l261_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("as-call_indirect-last") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(&VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(&vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c46_l261_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c46_l261_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 263
|
||||
fn c47_l263_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 10
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 6
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 17
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
@ -286,10 +288,70 @@ fn c19_l77_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 78
|
||||
fn c20_l78_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c20_l78_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callt") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(7 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c20_l78_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c20_l78_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 79
|
||||
fn c21_l79_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c21_l79_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callt") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(100 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c21_l79_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c21_l79_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 80
|
||||
fn c22_l80_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c22_l80_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callt") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(-1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c22_l80_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c22_l80_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 82
|
||||
fn c23_l82_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -376,10 +438,70 @@ fn c29_l88_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 89
|
||||
fn c30_l89_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c30_l89_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callu") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(7 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c30_l89_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c30_l89_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 90
|
||||
fn c31_l90_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c31_l90_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callu") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(100 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c31_l90_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c31_l90_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 91
|
||||
fn c32_l91_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c32_l91_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("callu") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(-1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c32_l91_assert_trap() {
|
||||
let result_object = create_module_2();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c32_l91_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 93
|
||||
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
@ -649,6 +651,26 @@ fn c31_l221_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 222
|
||||
fn c32_l222_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c32_l222_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("as-call_indirect-last") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(&VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(&vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c32_l222_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c32_l222_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 224
|
||||
fn c33_l224_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
@ -456,10 +458,70 @@ fn c24_l60_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 62
|
||||
fn c25_l62_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c25_l62_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c25_l62_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c25_l62_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 63
|
||||
fn c26_l63_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c26_l63_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c26_l63_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c26_l63_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 64
|
||||
fn c27_l64_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c27_l64_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(-2147483648 as i32, -1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c27_l64_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c27_l64_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 65
|
||||
fn c28_l65_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -654,8 +716,48 @@ fn c43_l80_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 82
|
||||
fn c44_l82_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c44_l82_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c44_l82_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c44_l82_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 83
|
||||
fn c45_l83_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c45_l83_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c45_l83_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c45_l83_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 84
|
||||
fn c46_l84_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -826,8 +928,48 @@ fn c59_l97_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 99
|
||||
fn c60_l99_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c60_l99_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c60_l99_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c60_l99_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 100
|
||||
fn c61_l100_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c61_l100_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c61_l100_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c61_l100_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 101
|
||||
fn c62_l101_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -1046,8 +1188,48 @@ fn c79_l118_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 120
|
||||
fn c80_l120_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c80_l120_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c80_l120_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c80_l120_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 121
|
||||
fn c81_l121_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c81_l121_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, 0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c81_l121_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c81_l121_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 122
|
||||
fn c82_l122_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
@ -458,10 +460,70 @@ fn c24_l60_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 62
|
||||
fn c25_l62_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c25_l62_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c25_l62_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c25_l62_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 63
|
||||
fn c26_l63_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c26_l63_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c26_l63_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c26_l63_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 64
|
||||
fn c27_l64_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c27_l64_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(-9223372036854775808 as i64, -1 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c27_l64_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c27_l64_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 65
|
||||
fn c28_l65_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -656,8 +718,48 @@ fn c43_l80_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 82
|
||||
fn c44_l82_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c44_l82_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c44_l82_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c44_l82_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 83
|
||||
fn c45_l83_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c45_l83_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("div_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c45_l83_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c45_l83_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 84
|
||||
fn c46_l84_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -828,8 +930,48 @@ fn c59_l97_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 99
|
||||
fn c60_l99_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c60_l99_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c60_l99_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c60_l99_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 100
|
||||
fn c61_l100_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c61_l100_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_s") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c61_l100_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c61_l100_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 101
|
||||
fn c62_l101_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
@ -1048,8 +1190,48 @@ fn c79_l118_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 120
|
||||
fn c80_l120_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c80_l120_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c80_l120_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c80_l120_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 121
|
||||
fn c81_l121_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c81_l121_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("rem_u") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, 0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c81_l121_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c81_l121_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 122
|
||||
fn c82_l122_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
@ -1207,6 +1209,26 @@ fn c47_l439_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 440
|
||||
fn c48_l440_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c48_l440_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("as-call_indirect-last") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c48_l440_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c48_l440_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 442
|
||||
fn c49_l442_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 2
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 5
|
||||
|
@ -3,4 +3,69 @@
|
||||
|
||||
// The _common module is not autogenerated, as it provides common functions for the spectests
|
||||
mod _common;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod address;
|
||||
mod align;
|
||||
mod binary;
|
||||
mod block;
|
||||
mod br;
|
||||
mod br_if;
|
||||
mod br_table;
|
||||
mod break_drop;
|
||||
mod call;
|
||||
mod call_indirect;
|
||||
mod comments;
|
||||
mod const_;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod conversions;
|
||||
mod custom;
|
||||
mod data;
|
||||
mod endianness;
|
||||
mod exports;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f32_;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f32_bitwise;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f32_cmp;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f64_;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f64_bitwise;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod f64_cmp;
|
||||
mod fac;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod float_exprs;
|
||||
mod float_literals;
|
||||
mod float_memory;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod float_misc;
|
||||
mod forward;
|
||||
mod func;
|
||||
mod func_ptrs;
|
||||
mod get_local;
|
||||
mod globals;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod i32_;
|
||||
#[cfg(not(feature = "fast-tests"))]
|
||||
mod i64_;
|
||||
mod if_;
|
||||
mod int_exprs;
|
||||
mod int_literals;
|
||||
mod labels;
|
||||
mod left_to_right;
|
||||
mod loop_;
|
||||
mod memory;
|
||||
mod memory_redundancy;
|
||||
mod nop;
|
||||
mod return_;
|
||||
mod select;
|
||||
mod set_local;
|
||||
mod stack;
|
||||
mod start;
|
||||
mod store_retval;
|
||||
mod switch;
|
||||
mod tee_local;
|
||||
mod typecheck;
|
||||
mod types;
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
@ -379,12 +381,92 @@ fn c24_l57_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 59
|
||||
fn c25_l59_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c25_l59_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("select_trap_l") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c25_l59_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c25_l59_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 60
|
||||
fn c26_l60_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c26_l60_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("select_trap_l") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c26_l60_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c26_l60_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 61
|
||||
fn c27_l61_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c27_l61_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("select_trap_r") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(1 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c27_l61_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c27_l61_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 62
|
||||
fn c28_l62_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c28_l62_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("select_trap_r") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i32, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c28_l62_assert_trap() {
|
||||
let result_object = create_module_1();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c28_l62_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 65
|
||||
#[test]
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 2
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 2
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 1
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 4
|
||||
|
@ -5,12 +5,14 @@
|
||||
warnings,
|
||||
dead_code
|
||||
)]
|
||||
use std::panic;
|
||||
use wabt::wat2wasm;
|
||||
|
||||
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
|
||||
use super::_common::{
|
||||
spectest_importobject,
|
||||
NaNCheck,
|
||||
};
|
||||
use wabt::wat2wasm;
|
||||
|
||||
|
||||
// Line 3
|
||||
|
Loading…
Reference in New Issue
Block a user