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

Function undef_in_entry

cranelift/frontend/src/ssa.rs:1173–1189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1171
1172 #[test]
1173 fn undef_in_entry() {
1174 // Use a var which has not been defined. The search should hit the
1175 // top of the entry block, and then fall back to inserting an iconst.
1176 let mut func = Function::new();
1177 let mut ssa = SSABuilder::default();
1178 let block0 = func.dfg.make_block();
1179 ssa.declare_block(block0);
1180 ssa.seal_block(block0, &mut func);
1181 let x_var = Variable::new(0);
1182 assert_eq!(func.dfg.num_block_params(block0), 0);
1183 ssa.use_var(&mut func, x_var, I32, block0);
1184 assert_eq!(func.dfg.num_block_params(block0), 0);
1185 assert_eq!(
1186 func.dfg.insts[func.layout.first_inst(block0).unwrap()].opcode(),
1187 Opcode::Iconst
1188 );
1189 }
1190
1191 #[test]
1192 fn undef_in_entry_sealed_after() {

Callers

nothing calls this directly

Calls 5

make_blockMethod · 0.80
declare_blockMethod · 0.80
newFunction · 0.50
seal_blockMethod · 0.45
use_varMethod · 0.45

Tested by

no test coverage detected