()
| 2188 | |
| 2189 | #[test] |
| 2190 | fn bad_instruction_format() { |
| 2191 | let mut func = Function::new(); |
| 2192 | let block0 = func.dfg.make_block(); |
| 2193 | func.layout.append_block(block0); |
| 2194 | let nullary_with_bad_opcode = func.dfg.make_inst(InstructionData::UnaryImm { |
| 2195 | opcode: Opcode::F32const, |
| 2196 | imm: 0.into(), |
| 2197 | }); |
| 2198 | func.layout.append_inst(nullary_with_bad_opcode, block0); |
| 2199 | let destination = func.dfg.block_call(block0, &[]); |
| 2200 | func.stencil.layout.append_inst( |
| 2201 | func.stencil.dfg.make_inst(InstructionData::Jump { |
| 2202 | opcode: Opcode::Jump, |
| 2203 | destination, |
| 2204 | }), |
| 2205 | block0, |
| 2206 | ); |
| 2207 | let flags = &settings::Flags::new(settings::builder()); |
| 2208 | let verifier = Verifier::new(&func, flags.into()); |
| 2209 | let mut errors = VerifierErrors::default(); |
| 2210 | |
| 2211 | let _ = verifier.run(&mut errors); |
| 2212 | |
| 2213 | assert_err_with_msg!(errors, "instruction format"); |
| 2214 | } |
| 2215 | |
| 2216 | fn test_iconst_bounds(immediate: i64, ctrl_typevar: Type) -> VerifierErrors { |
| 2217 | let mut func = Function::new(); |
nothing calls this directly
no test coverage detected