()
| 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() { |
nothing calls this directly
no test coverage detected