()
| 581 | "#, |
| 582 | ); |
| 583 | assert_eq!(exit, Some(0)); |
| 584 | } |
| 585 | |
| 586 | // Regression: returning another function's >16-byte enum result used to take |
| 587 | // the scalar return path and drop the sret copy (Named alias left unresolved). |
| 588 | #[test] |
| 589 | fn hosted_sret_enum_result_forwarding() { |
| 590 | let (_, exit) = run_hll( |
| 591 | r#" |
| 592 | memory_allocator := import("memory_allocator") |
| 593 | |
| 594 | enum ProbeError { |
| 595 | Wrapped(AllocError) |
| 596 | BadBytes |
| 597 | } |
| 598 | |
| 599 | struct Thing { x: u64 } |
| 600 | |
| 601 | impl Thing { |
| 602 | inner: (self: Thing*, data: u8[]) -> Result<u64, ProbeError> { |
| 603 | return Ok(data.len) |
nothing calls this directly
no test coverage detected