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

Function forward_call_works

tests/all/relocs.rs:37–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36#[test]
37fn forward_call_works() -> Result<()> {
38 let mut store = store_with_padding(PADDING)?;
39 let module = Module::new(
40 store.engine(),
41 r#"
42 (module
43 (func (export "foo") (result i32)
44 call 1)
45 (func (result i32)
46 i32.const 4)
47 )
48 "#,
49 )?;
50
51 let i = Instance::new(&mut store, &module, &[])?;
52 let foo = i.get_typed_func::<(), i32>(&mut store, "foo")?;
53 assert_eq!(foo.call(&mut store, ())?, 4);
54 Ok(())
55}
56
57#[test]
58fn backwards_call_works() -> Result<()> {

Callers

nothing calls this directly

Calls 4

store_with_paddingFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45

Tested by

no test coverage detected