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

Function stack_values_dead_gc_ref

tests/all/debug.rs:179–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177#[test]
178#[cfg_attr(miri, ignore)]
179fn stack_values_dead_gc_ref() -> wasmtime::Result<()> {
180 test_stack_values(
181 r#"
182 (module
183 (type $s (struct))
184 (import "" "host" (func))
185 (func (export "main")
186 (struct.new $s)
187 (call 0)
188 (drop)))
189 "#,
190 |config| {
191 config.wasm_gc(true);
192 },
193 |mut caller: Caller<'_, ()>| {
194 let stack = caller.debug_exit_frames().next().unwrap();
195 assert_eq!(stack.num_stacks(&mut caller)?, 1);
196 assert!(stack.stack(&mut caller, 0)?.unwrap_anyref().is_some());
197 let stack = stack.parent(&mut caller)?;
198 assert!(stack.is_none());
199 Ok(())
200 },
201 )
202}
203
204#[test]
205#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

test_stack_valuesFunction · 0.85
OkFunction · 0.85
debug_exit_framesMethod · 0.80
wasm_gcMethod · 0.45
unwrapMethod · 0.45
nextMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected