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

Function block_header

cranelift/reader/src/parser.rs:3221–3241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3219
3220 #[test]
3221 fn block_header() {
3222 let (func, _) = Parser::new(
3223 "function %blocks() system_v {
3224 block0:
3225 block4(v3: i32):
3226 }",
3227 )
3228 .parse_function()
3229 .unwrap();
3230 assert_eq!(func.name.to_string(), "%blocks");
3231
3232 let mut blocks = func.layout.blocks();
3233
3234 let block0 = blocks.next().unwrap();
3235 assert_eq!(func.dfg.block_params(block0), &[]);
3236
3237 let block4 = blocks.next().unwrap();
3238 let block4_args = func.dfg.block_params(block4);
3239 assert_eq!(block4_args.len(), 1);
3240 assert_eq!(func.dfg.value_type(block4_args[0]), types::I32);
3241 }
3242
3243 #[test]
3244 fn duplicate_block() {

Callers

nothing calls this directly

Calls 6

parse_functionMethod · 0.80
blocksMethod · 0.80
newFunction · 0.50
unwrapMethod · 0.45
nextMethod · 0.45
block_paramsMethod · 0.45

Tested by

no test coverage detected