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

Function run_kernel_hll

tests/integration/platform_stdlib.rs:439–480  ·  view source on GitHub ↗

Compile user code linked against the kernel stdlib. The kernel stdlib uses the "__kern_str_" string-label prefix so rodata labels never clash with user-code labels (which use "str_").

(user_src: &str)

Source from the content-addressed store, hash-verified

437 console.putchar(83)
438 }
439 return 0
440}
441"#,
442 );
443 assert_eq!(uart, "PASS");
444 assert_eq!(exit, Some(0));
445}
446
447#[test]
448fn mem_cmp_detects_difference() {
449 // The first differing byte determines the sign.
450 let (uart, exit) = run_hll(
451 r#"
452console := import("console")
453mem := import("mem")
454
455main: () -> i32 {
456 a: u8[2] = []
457 b: u8[2] = []
458 a[0] = 65
459 a[1] = 66
460 b[0] = 65
461 b[1] = 67
462 a_ptr: u8* = &a[0]
463 b_ptr: u8* = &b[0]
464 result: i32 = mem.cmp(a_ptr, b_ptr, 2)
465 if result < 0 {
466 console.putchar(80)
467 console.putchar(65)
468 console.putchar(83)
469 console.putchar(83)
470 }
471 return 0
472}
473"#,
474 );
475 assert_eq!(uart, "PASS");
476 assert_eq!(exit, Some(0));
477}
478
479// --- klog.hll ---
480
481#[test]
482fn klog_ok_output() {
483 let (uart, exit) = run_with(

Calls 11

compile_stdlib_objectsFunction · 0.85
set_write_artifactsMethod · 0.80
set_source_preludeMethod · 0.80
mark_entry_globalMethod · 0.80
collectMethod · 0.80
pushMethod · 0.80
compileMethod · 0.45
assembleMethod · 0.45
runMethod · 0.45