()
| 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() { |
nothing calls this directly
no test coverage detected