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

Function stack_slot

cranelift/codegen/src/ir/stackslot.rs:195–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193
194 #[test]
195 fn stack_slot() {
196 let mut func = Function::new();
197
198 let ss0 =
199 func.create_sized_stack_slot(StackSlotData::new(StackSlotKind::ExplicitSlot, 4, 0));
200 let ss1 =
201 func.create_sized_stack_slot(StackSlotData::new(StackSlotKind::ExplicitSlot, 8, 0));
202 assert_eq!(ss0.to_string(), "ss0");
203 assert_eq!(ss1.to_string(), "ss1");
204
205 assert_eq!(func.sized_stack_slots[ss0].size, 4);
206 assert_eq!(func.sized_stack_slots[ss1].size, 8);
207
208 assert_eq!(func.sized_stack_slots[ss0].to_string(), "explicit_slot 4");
209 assert_eq!(func.sized_stack_slots[ss1].to_string(), "explicit_slot 8");
210 }
211
212 #[test]
213 fn dynamic_stack_slot() {

Callers

nothing calls this directly

Calls 2

newFunction · 0.50

Tested by

no test coverage detected