This commit is contained in:
nora 2023-10-15 21:10:37 +02:00
parent 5ef748c2c5
commit b76d57ee9d
9 changed files with 226 additions and 36 deletions

View file

@ -0,0 +1,56 @@
use std::process::Command;
use crate::prelude::*;
use super::run;
#[test]
fn single_object_file() {
let ctx = ctx();
let empty = ctx.nasm(
"empty",
"
global _start
section .text
_start:
mov rax, 60
mov rdi, 0
syscall
",
);
let out = elven_wald!(ctx; empty);
run(Command::new(out));
}
#[test]
fn two_object_files() {
let ctx = ctx();
let start = ctx.nasm(
"start",
"
global _start
extern exit
section .text
_start:
call exit
",
);
let exit = ctx.nasm(
"exit",
"
global exit
section .text
exit:
mov rax, 60
mov rdi, 0
syscall
",
);
let out = elven_wald!(ctx; start, exit);
run(Command::new(out));
}