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

Function backwards_call_works

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

Source from the content-addressed store, hash-verified

56
57#[test]
58fn backwards_call_works() -> Result<()> {
59 let mut store = store_with_padding(PADDING)?;
60 let module = Module::new(
61 store.engine(),
62 r#"
63 (module
64 (func (result i32)
65 i32.const 4)
66 (func (export "foo") (result i32)
67 call 0)
68 )
69 "#,
70 )?;
71
72 let i = Instance::new(&mut store, &module, &[])?;
73 let foo = i.get_typed_func::<(), i32>(&mut store, "foo")?;
74 assert_eq!(foo.call(&mut store, ())?, 4);
75 Ok(())
76}
77
78#[test]
79fn mixed() -> 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