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

Function parse_cold_blocks

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

Source from the content-addressed store, hash-verified

3757
3758 #[test]
3759 fn parse_cold_blocks() {
3760 let code = "function %test() {
3761 block0 cold:
3762 return
3763 block1(v0: i32) cold:
3764 return
3765 block2(v1: i32):
3766 return
3767 }";
3768
3769 let mut parser = Parser::new(code);
3770 let func = parser.parse_function().unwrap().0;
3771 assert_eq!(func.layout.blocks().count(), 3);
3772 assert!(func.layout.is_cold(Block::from_u32(0)));
3773 assert!(func.layout.is_cold(Block::from_u32(1)));
3774 assert!(!func.layout.is_cold(Block::from_u32(2)));
3775 }
3776}

Callers

nothing calls this directly

Calls 3

parse_functionMethod · 0.80
newFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected