()
| 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] |
| 125 | fn putchar_basic() { |
| 126 | let src = r#" |
| 127 | console := import("console") |
| 128 | |
| 129 | main: () -> i32 { |
| 130 | console.putchar(72) |
| 131 | console.putchar(105) |
| 132 | console.putchar(10) |
| 133 | return 0 |
nothing calls this directly
no test coverage detected