()
| 701 | #[test] |
| 702 | #[cfg_attr(miri, ignore)] |
| 703 | fn table_init_with_externref_global_get() -> wasmtime::Result<()> { |
| 704 | let dropped = Arc::new(AtomicBool::new(false)); |
| 705 | |
| 706 | let mut config = Config::new(); |
| 707 | config.wasm_function_references(true); |
| 708 | let engine = Engine::new(&config)?; |
| 709 | let mut store = Store::new(&engine, ()); |
| 710 | let module = Module::new( |
| 711 | &engine, |
| 712 | r#" |
| 713 | (module |
| 714 | (import "" "" (global $init externref)) |
| 715 | (table $t 1 externref (global.get $init)) |
| 716 | ) |
| 717 | "#, |
| 718 | )?; |
| 719 | |
| 720 | let externref = ExternRef::new(&mut store, SetFlagOnDrop(dropped.clone()))?; |
| 721 | let global = Global::new( |
| 722 | &mut store, |
| 723 | GlobalType::new(ValType::EXTERNREF, Mutability::Const), |
| 724 | externref.into(), |
| 725 | )?; |
| 726 | |
| 727 | Instance::new(&mut store, &module, &[global.into()])?; |
| 728 | |
| 729 | drop(store); |
| 730 | |
| 731 | assert!(dropped.load(SeqCst)); |
| 732 | Ok(()) |
| 733 | } |
| 734 | |
| 735 | #[test] |
| 736 | fn rooted_gets_collected_after_scope_exit() -> Result<()> { |
nothing calls this directly
no test coverage detected