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

Function malloc_write_read_roundtrip

crates/os-runtime/tests/boot.rs:668–691  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

666 kshutdown(1)
667 return
668 }
669 kshutdown(0)
670}
671"#,
672 ]
673 .concat();
674 let (_, exit) = run_kernel_hll(&src);
675 assert_eq!(
676 exit,
677 Some(0),
678 "malloc(0) must be coerced to malloc(1) and return non-null"
679 );
680}
681
682#[test]
683fn malloc_write_read_roundtrip() {
684 let src = [
685 MALLOC_PRELUDE,
686 r#"
687kmain: () {
688 p: i64* = malloc(8) as i64*
689 if p == null {
690 kshutdown(1)
691 return
692 }
693 @p = 12345
694 if @p != 12345 {

Callers

nothing calls this directly

Calls 1

run_kernel_hllFunction · 0.70

Tested by

no test coverage detected