()
| 473 | // -- Stack allocation and pointer load/store ----------------------------------- |
| 474 | |
| 475 | #[test] |
| 476 | fn stack_variable_emits_alloc() { |
| 477 | let source = r#"main: () -> i32 { |
| 478 | x: i32 = 10 |
| 479 | return x |
| 480 | }"#; |
| 481 | assert!(has_instruction(source, |i| matches!( |
| 482 | i, |
| 483 | IrInstruction::Alloc { .. } |
| 484 | ))); |
| 485 | } |
| 486 | |
| 487 | #[test] |
| 488 | fn address_of_emits_alloc_and_load() { |
nothing calls this directly
no outgoing calls
no test coverage detected