()
| 282 | |
| 283 | #[test] |
| 284 | pub fn function_inc_codegen() { |
| 285 | let mut ir = IR::new(); |
| 286 | let mut f = Node::function::<1, 1>(&mut ir); |
| 287 | let port = f.add_argument(&mut ir); |
| 288 | let ret_port = f.add_return(&mut ir); |
| 289 | let mut inc = Node::simple(Operation::Inc); |
| 290 | f.add_body(inc, &mut ir, |inc, r| { |
| 291 | inc.connect_input(0, port, r); |
| 292 | inc.connect_output(0, ret_port, r); |
| 293 | }); |
| 294 | ir.set_body(f); |
| 295 | let hello_fn: extern "C" fn(usize) -> usize = ir.compile_fn().unwrap().0; |
| 296 | assert_eq!(hello_fn(1), 2); |
| 297 | } |
| 298 | |
| 299 | #[test] |
| 300 | pub fn function_add_codegen() { |
nothing calls this directly
no test coverage detected