MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / kernel_cc_target_roundtrips

Function kernel_cc_target_roundtrips

tests/integration/kernel_integration.rs:1599–1636  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1597";
1598
1599 let (outcome, uart) = run_tool_session(
1600 &["as", "ld"],
1601 &[("/a.s", a_s), ("/b.s", b_s)],
1602 "as /a.s /a.o\nas /b.s /b.o\nld /a.o /b.o /prog\nrun /prog\nexit\n",
1603 300_000_000,
1604 );
1605
1606 assert!(!uart.contains("PANIC!"), "kernel panicked; uart={uart:?}");
1607 assert!(
1608 !uart.contains("unhandled exception"),
1609 "the linked program faulted; uart={uart:?}"
1610 );
1611 assert!(
1612 uart.contains("as: wrote /a.o") && uart.contains("as: wrote /b.o"),
1613 "assembler did not emit both objects; uart={uart:?}"
1614 );
1615 assert!(
1616 uart.contains("ld: wrote /prog"),
1617 "linker did not report success; uart={uart:?}"
1618 );
1619 assert!(
1620 uart.contains("[exit 42]"),
1621 "linked program did not exit 42 (relocations wrong?); uart={uart:?}"
1622 );
1623 assert!(
1624 matches!(outcome, StepOutcome::Halted(0)),
1625 "shell did not survive and exit cleanly; outcome={outcome:?} uart={uart:?}"
1626 );
1627}
1628
1629// The client inlines no I/O, so puts/putc/exit resolve at link time against a
1630// separately assembled stdlib.s. Covers CALL_PLT, a local call, and PCREL_HI20.
1631#[test]
1632fn kernel_ld_links_stdlib_and_runs() {
1633 let client_s = b"\
1634.globl _start
1635.text
1636_start:
1637 la a0, msg
1638 call puts
1639 li a0, 33

Callers

nothing calls this directly

Calls 3

assembled_to_elf_fileFunction · 0.85
compile_hostedFunction · 0.85
run_tool_sessionFunction · 0.85

Tested by

no test coverage detected