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

Function assignment_and_retrieval

cranelift/interpreter/src/frame.rs:142–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140
141 #[test]
142 fn assignment_and_retrieval() {
143 let func = function("function %test(i32) -> i32 { block0(v0:i32): return v0 }");
144 let mut frame = Frame::new(&func);
145 let ssa_value_ref = ValueRef::from_u32(0);
146 let fortytwo = DataValue::I32(42);
147
148 // Verify that setting a valid SSA ref will make the value retrievable.
149 frame.set(ssa_value_ref, fortytwo.clone());
150 assert_eq!(frame.get(ssa_value_ref), &fortytwo);
151 }
152
153 #[test]
154 fn assignment_to_extra_slots() {

Callers

nothing calls this directly

Calls 4

functionFunction · 0.85
newFunction · 0.50
setMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected