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

Function stdlib_provides_malloc

tests/vm_diag_test.rs:112–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 let mut tokens = Vec::new();
111 for (_, src) in get_stdlib_modules_for_mode(TargetMode::Hosted).iter() {
112 let result = pipeline.compile(src).expect("stdlib compile");
113 let (_, t) = pipeline.compile_ir_to_assembly_with_tokens(&result.ir_program);
114 tokens.extend(t);
115 }
116 assert!(!tokens.is_empty(), "stdlib token stream must not be empty");
117 let has_malloc = tokens.iter().any(|t| {
118 use asm_to_binary::rv_instruction::RvInstruction;
119 matches!(t, RvInstruction::Label(n) if n == "malloc")
120 });
121 assert!(has_malloc, "stdlib must define malloc");
122}
123
124#[test]
125fn putchar_basic() {
126 let src = r#"
127console := import("console")
128
129main: () -> i32 {
130 console.putchar(72)
131 console.putchar(105)
132 console.putchar(10)
133 return 0

Callers

nothing calls this directly

Calls 7

get_stdlib_type_preludeFunction · 0.85
set_write_artifactsMethod · 0.80
anyMethod · 0.80
set_type_preludeMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected