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

Function issue_9714

tests/all/structs.rs:881–912  ·  view source on GitHub ↗
(config: &mut Config)

Source from the content-addressed store, hash-verified

879#[wasmtime_test(wasm_features(function_references, gc))]
880#[cfg_attr(miri, ignore)]
881fn issue_9714(config: &mut Config) -> Result<()> {
882 let engine = Engine::new(config)?;
883
884 let module = Module::new(
885 &engine,
886 r#"
887 (module
888 (rec (type $a (struct))
889 (type $b (struct)))
890 (rec (type $c (struct)))
891
892 (func (export "fa") (result (ref null $a)) unreachable)
893 (func (export "fb") (result (ref null $b)) unreachable)
894 (func (export "fc") (result (ref null $c)) unreachable)
895 )
896 "#,
897 )?;
898
899 let mut store = Store::new(&engine, ());
900
901 for exp in module.exports() {
902 let res_ty = exp.ty().unwrap_func().result(0).unwrap();
903 let struct_ty = res_ty
904 .unwrap_ref()
905 .heap_type()
906 .unwrap_concrete_struct()
907 .clone();
908 let _ = StructRefPre::new(&mut store, struct_ty);
909 }
910
911 Ok(())
912}
913
914#[test]
915#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 11

OkFunction · 0.85
heap_typeMethod · 0.80
unwrap_refMethod · 0.80
newFunction · 0.50
exportsMethod · 0.45
unwrapMethod · 0.45
resultMethod · 0.45
unwrap_funcMethod · 0.45
tyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected