()
| 340 | #[test] |
| 341 | #[cfg_attr(miri, ignore)] |
| 342 | fn instance_pre() -> Result<()> { |
| 343 | let engine = Engine::default(); |
| 344 | let mut linker = Linker::new(&engine); |
| 345 | linker.func_wrap("", "", || {})?; |
| 346 | |
| 347 | let module = Module::new(&engine, r#"(module (import "" "" (func)))"#)?; |
| 348 | let instance_pre = linker.instantiate_pre(&module)?; |
| 349 | instance_pre.instantiate(&mut Store::new(&engine, ()))?; |
| 350 | instance_pre.instantiate(&mut Store::new(&engine, ()))?; |
| 351 | |
| 352 | let mut store = Store::new(&engine, ()); |
| 353 | let global = Global::new( |
| 354 | &mut store, |
| 355 | GlobalType::new(ValType::I32, Mutability::Const), |
| 356 | 1.into(), |
| 357 | )?; |
| 358 | linker.define(&mut store, "", "g", global)?; |
| 359 | |
| 360 | let module = Module::new( |
| 361 | &engine, |
| 362 | r#"(module |
| 363 | (import "" "" (func)) |
| 364 | (import "" "g" (global i32)) |
| 365 | )"#, |
| 366 | )?; |
| 367 | let instance_pre = linker.instantiate_pre(&module)?; |
| 368 | instance_pre.instantiate(&mut store)?; |
| 369 | instance_pre.instantiate(&mut store)?; |
| 370 | Ok(()) |
| 371 | } |
| 372 | |
| 373 | #[test] |
| 374 | #[cfg_attr(miri, ignore)] |
nothing calls this directly
no test coverage detected