MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_stack_values

Function test_stack_values

tests/all/debug.rs:49–70  ·  view source on GitHub ↗
(
    wat: &str,
    c: C,
    f: F,
)

Source from the content-addressed store, hash-verified

47}
48
49fn test_stack_values<
50 C: Fn(&mut Config),
51 F: Fn(Caller<'_, ()>) -> wasmtime::Result<()> + Send + Sync + 'static,
52>(
53 wat: &str,
54 c: C,
55 f: F,
56) -> wasmtime::Result<()> {
57 let (module, mut store) = get_module_and_store(c, wat)?;
58 let func = Func::wrap(&mut store, move |caller: Caller<'_, ()>| {
59 f(caller)?;
60 Ok(())
61 });
62 let instance = Instance::new(&mut store, &module, &[Extern::Func(func)])?;
63 let mut results = [];
64 instance
65 .get_func(&mut store, "main")
66 .unwrap()
67 .call(&mut store, &[], &mut results)?;
68
69 Ok(())
70}
71
72#[test]
73#[cfg_attr(miri, ignore)]

Callers 4

stack_values_two_framesFunction · 0.85
stack_values_exceptionsFunction · 0.85
stack_values_dead_gc_refFunction · 0.85
gc_access_during_callFunction · 0.85

Calls 8

get_module_and_storeFunction · 0.85
OkFunction · 0.85
fFunction · 0.50
newFunction · 0.50
FuncEnum · 0.50
callMethod · 0.45
unwrapMethod · 0.45
get_funcMethod · 0.45

Tested by

no test coverage detected