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

Function no_predecessors

cranelift/codegen/src/flowgraph.rs:210–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

make_blockMethod · 0.80
append_blockMethod · 0.80
blocksMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected