()
| 208 | |
| 209 | #[test] |
| 210 | fn no_predecessors() { |
| 211 | let mut func = Function::new(); |
| 212 | let block0 = func.dfg.make_block(); |
| 213 | let block1 = func.dfg.make_block(); |
| 214 | let block2 = func.dfg.make_block(); |
| 215 | func.layout.append_block(block0); |
| 216 | func.layout.append_block(block1); |
| 217 | func.layout.append_block(block2); |
| 218 | |
| 219 | let cfg = ControlFlowGraph::with_function(&func); |
| 220 | |
| 221 | let mut fun_blocks = func.layout.blocks(); |
| 222 | for block in func.layout.blocks() { |
| 223 | assert_eq!(block, fun_blocks.next().unwrap()); |
| 224 | assert_eq!(cfg.pred_iter(block).count(), 0); |
| 225 | assert_eq!(cfg.succ_iter(block).count(), 0); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | #[test] |
| 230 | fn branches_and_jumps() { |
nothing calls this directly
no test coverage detected