mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
commit
18ece1216f
@ -11,7 +11,7 @@ jobs:
|
||||
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
|
||||
- run: sudo apt-get install -y cmake
|
||||
- run: rustup default nightly-2018-10-07
|
||||
- run: cargo test
|
||||
- run: make test
|
||||
|
||||
- save_cache:
|
||||
paths:
|
||||
|
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -278,6 +278,18 @@ dependencies = [
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "0.4.20"
|
||||
@ -559,6 +571,11 @@ name = "version_check"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "void"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "wabt"
|
||||
version = "0.6.0"
|
||||
@ -592,6 +609,7 @@ dependencies = [
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"region 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -666,6 +684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum mach 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2fd13ee2dd61cc82833ba05ade5a30bb3d63f7ced605ef827063c63078302de9"
|
||||
"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b"
|
||||
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
|
||||
"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
|
||||
"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee"
|
||||
"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
|
||||
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
|
||||
@ -702,6 +721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4"
|
||||
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
|
||||
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
|
||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||
"checksum wabt 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0768faf932f2898c0a7545edee648fefa716906a2e143009addf4959d2335a75"
|
||||
"checksum wabt-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4aaa9a8fa0d698315da5611f3e113a1e688fbb8d6fa0dd9510dfa023f665e9dc"
|
||||
"checksum wasmparser 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc6511bad33610d7798f80d48e10495a6eb4f1e39306b0bb340b2de0816c4ca"
|
||||
|
@ -42,6 +42,7 @@ spin = "0.4.10"
|
||||
log = "0.4.5"
|
||||
target-lexicon = { version = "0.0.3", default-features = false }
|
||||
libc = "0.2"
|
||||
nix = "0.11"
|
||||
|
||||
[build-dependencies]
|
||||
wabt = "0.6.0"
|
||||
|
2
Makefile
2
Makefile
@ -14,4 +14,4 @@ install:
|
||||
cargo install --path .
|
||||
|
||||
test:
|
||||
cargo test
|
||||
cargo test -- --test-threads=1
|
||||
|
@ -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))
|
||||
|
@ -162,12 +162,14 @@ impl WastTestGenerator {
|
||||
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;\n\n",
|
||||
}};\n\n",
|
||||
self.filename
|
||||
));
|
||||
while let Some(Command { line, kind }) = &self.script_parser.next().unwrap() {
|
||||
@ -277,7 +279,11 @@ fn {}_assert_invalid() {{
|
||||
|
||||
fn visit_assert_return_arithmetic_nan(&mut self, action: &Action) {
|
||||
match action {
|
||||
Action::Invoke { module, field, args, } => {
|
||||
Action::Invoke {
|
||||
module,
|
||||
field,
|
||||
args,
|
||||
} => {
|
||||
let mut return_type = wabt2rust_type(&args[0]);
|
||||
let mut func_return = format!(" -> {}", return_type);
|
||||
let assertion = String::from("assert!(result.is_quiet_nan())");
|
||||
@ -326,7 +332,11 @@ fn {}_assert_invalid() {{
|
||||
// and wabt does gives us the `expected` result
|
||||
fn visit_assert_return_canonical_nan(&mut self, action: &Action) {
|
||||
match action {
|
||||
Action::Invoke { module, field, args, } => {
|
||||
Action::Invoke {
|
||||
module,
|
||||
field,
|
||||
args,
|
||||
} => {
|
||||
let mut return_type = match &field.as_str() {
|
||||
&"f64.promote_f32" => String::from("f64"),
|
||||
&"f32.promote_f64" => String::from("f32"),
|
||||
@ -487,6 +497,39 @@ fn {}_assert_malformed() {{
|
||||
.or_insert(Vec::new())
|
||||
.push(action_fn_name.unwrap());
|
||||
}
|
||||
fn visit_assert_trap(&mut self, action: &Action) {
|
||||
let action_fn_name = self.visit_action(action, None);
|
||||
|
||||
if action_fn_name.is_none() {
|
||||
return;
|
||||
}
|
||||
let trap_func_name = format!("{}_assert_trap", self.command_name());
|
||||
self.buffer.push_str(
|
||||
format!(
|
||||
"
|
||||
#[test]
|
||||
fn {}() {{
|
||||
let result_object = create_module_{}();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {{
|
||||
{}(&result_object, &vm_context);
|
||||
}});
|
||||
assert!(result.is_err());
|
||||
}}\n",
|
||||
trap_func_name,
|
||||
self.last_module,
|
||||
action_fn_name.unwrap(),
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
// 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) {
|
||||
match cmd {
|
||||
@ -503,7 +546,7 @@ fn {}_assert_malformed() {{
|
||||
self.visit_assert_return_arithmetic_nan(action);
|
||||
}
|
||||
CommandKind::AssertTrap { action, message: _ } => {
|
||||
// Do nothing for now
|
||||
self.visit_assert_trap(action);
|
||||
}
|
||||
CommandKind::AssertInvalid { module, message: _ } => {
|
||||
self.visit_assert_invalid(module);
|
||||
|
@ -4,7 +4,12 @@
|
||||
#[macro_export]
|
||||
macro_rules! get_instance_function {
|
||||
($instance:expr, $func_index:expr) => {{
|
||||
use crate::sighandler::install_sighandler;
|
||||
use std::mem;
|
||||
|
||||
unsafe {
|
||||
install_sighandler();
|
||||
};
|
||||
let func_addr = $instance.get_function_pointer($func_index);
|
||||
unsafe { mem::transmute(func_addr) }
|
||||
}};
|
||||
|
@ -12,6 +12,7 @@ extern crate cranelift_wasm;
|
||||
extern crate wabt;
|
||||
#[macro_use]
|
||||
extern crate target_lexicon;
|
||||
extern crate nix;
|
||||
extern crate spin;
|
||||
|
||||
// use std::alloc::System;
|
||||
@ -37,6 +38,7 @@ use wabt::wat2wasm;
|
||||
mod macros;
|
||||
pub mod common;
|
||||
pub mod integrations;
|
||||
pub mod sighandler;
|
||||
#[cfg(test)]
|
||||
mod spectests;
|
||||
pub mod webassembly;
|
||||
|
39
src/sighandler.rs
Normal file
39
src/sighandler.rs
Normal file
@ -0,0 +1,39 @@
|
||||
//! We install signal handlers to handle WebAssembly traps within
|
||||
//! our Rust code. Otherwise we will have errors that stop the Rust process
|
||||
//! such as `process didn't exit successfully: ... (signal: 8, SIGFPE: erroneous arithmetic operation)`
|
||||
//!
|
||||
//! Please read more about this here: https://github.com/CraneStation/wasmtime/issues/15
|
||||
//! This code is inspired by: https://github.com/pepyakin/wasmtime/commit/625a2b6c0815b21996e111da51b9664feb174622
|
||||
use nix::sys::signal::{
|
||||
sigaction, SaFlags, SigAction, SigHandler, SigSet, SIGBUS, SIGFPE, SIGILL, SIGSEGV,
|
||||
};
|
||||
|
||||
pub unsafe fn install_sighandler() {
|
||||
let sa = SigAction::new(
|
||||
SigHandler::Handler(signal_trap_handler),
|
||||
SaFlags::empty(),
|
||||
SigSet::empty(),
|
||||
);
|
||||
sigaction(SIGFPE, &sa).unwrap();
|
||||
sigaction(SIGILL, &sa).unwrap();
|
||||
sigaction(SIGSEGV, &sa).unwrap();
|
||||
sigaction(SIGBUS, &sa).unwrap();
|
||||
let result = setjmp((&mut setjmp_buffer[..]).as_mut_ptr() as *mut ::nix::libc::c_void);
|
||||
if result != 0 {
|
||||
panic!("Signal Error: {}", result);
|
||||
}
|
||||
}
|
||||
|
||||
static mut setjmp_buffer: [::nix::libc::c_int; 27] = [0; 27];
|
||||
extern "C" {
|
||||
fn setjmp(env: *mut ::nix::libc::c_void) -> ::nix::libc::c_int;
|
||||
fn longjmp(env: *mut ::nix::libc::c_void, val: ::nix::libc::c_int);
|
||||
}
|
||||
extern "C" fn signal_trap_handler(_: ::nix::libc::c_int) {
|
||||
unsafe {
|
||||
longjmp(
|
||||
(&mut setjmp_buffer).as_mut_ptr() as *mut ::nix::libc::c_void,
|
||||
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
|
||||
@ -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) {
|
||||
|
@ -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
|
||||
@ -548,12 +550,92 @@ fn start_module_7(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 113
|
||||
fn c26_l113_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c26_l113_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.no_fold_div_s_self") {
|
||||
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_l113_assert_trap() {
|
||||
let result_object = create_module_7();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c26_l113_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 114
|
||||
fn c27_l114_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c27_l114_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.no_fold_div_u_self") {
|
||||
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 c27_l114_assert_trap() {
|
||||
let result_object = create_module_7();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c27_l114_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 115
|
||||
fn c28_l115_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c28_l115_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.no_fold_div_s_self") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c28_l115_assert_trap() {
|
||||
let result_object = create_module_7();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c28_l115_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 116
|
||||
fn c29_l116_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c29_l116_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.no_fold_div_u_self") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c29_l116_assert_trap() {
|
||||
let result_object = create_module_7();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c29_l116_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 120
|
||||
|
||||
@ -597,12 +679,92 @@ fn start_module_8(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 132
|
||||
fn c31_l132_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c31_l132_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.no_fold_rem_s_self") {
|
||||
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 c31_l132_assert_trap() {
|
||||
let result_object = create_module_8();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c31_l132_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 133
|
||||
fn c32_l133_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c32_l133_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.no_fold_rem_u_self") {
|
||||
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 c32_l133_assert_trap() {
|
||||
let result_object = create_module_8();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c32_l133_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 134
|
||||
fn c33_l134_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c33_l134_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.no_fold_rem_s_self") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c33_l134_assert_trap() {
|
||||
let result_object = create_module_8();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c33_l134_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 135
|
||||
fn c34_l135_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c34_l135_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.no_fold_rem_u_self") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(0 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c34_l135_assert_trap() {
|
||||
let result_object = create_module_8();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c34_l135_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 139
|
||||
|
||||
@ -861,12 +1023,92 @@ fn start_module_12(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 196
|
||||
fn c47_l196_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c47_l196_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.div_s_0") {
|
||||
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(71 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c47_l196_assert_trap() {
|
||||
let result_object = create_module_12();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c47_l196_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 197
|
||||
fn c48_l197_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c48_l197_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.div_u_0") {
|
||||
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(71 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c48_l197_assert_trap() {
|
||||
let result_object = create_module_12();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c48_l197_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 198
|
||||
fn c49_l198_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c49_l198_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.div_s_0") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(71 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c49_l198_assert_trap() {
|
||||
let result_object = create_module_12();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c49_l198_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 199
|
||||
fn c50_l199_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c50_l199_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.div_u_0") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(71 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c50_l199_assert_trap() {
|
||||
let result_object = create_module_12();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c50_l199_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 203
|
||||
|
||||
@ -1770,8 +2012,48 @@ fn start_module_19(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
}
|
||||
|
||||
// Line 349
|
||||
fn c106_l349_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c106_l349_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i32.no_fold_div_neg1") {
|
||||
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(-2147483648 as i32, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c106_l349_assert_trap() {
|
||||
let result_object = create_module_19();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c106_l349_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
// Line 350
|
||||
fn c107_l350_action_invoke(result_object: &ResultObject, vm_context: &VmCtx) {
|
||||
println!("Executing function {}", "c107_l350_action_invoke");
|
||||
let func_index = match result_object.module.info.exports.get("i64.no_fold_div_neg1") {
|
||||
Some(&Export::Function(index)) => index,
|
||||
_ => panic!("Function not found"),
|
||||
};
|
||||
let invoke_fn: fn(i64, &VmCtx) = get_instance_function!(result_object.instance, func_index);
|
||||
let result = invoke_fn(-9223372036854775808 as i64, &vm_context);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn c107_l350_assert_trap() {
|
||||
let result_object = create_module_19();
|
||||
let vm_context = result_object.instance.generate_context();
|
||||
let result = panic::catch_unwind(|| {
|
||||
c107_l350_action_invoke(&result_object, &vm_context);
|
||||
});
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_module_19() {
|
||||
|
@ -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
|
||||
|
@ -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