move x86_64 bin test

This commit is contained in:
2026-06-06 21:31:14 -04:00
parent a3f934be21
commit ba706ebb73
6 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,6 @@
mod asm; mod asm;
mod encode; mod encode;
mod reg; mod reg;
#[cfg(test)]
mod test; mod test;
use crate::{ use crate::{
@@ -13,6 +12,7 @@ use crate::{
pub use asm::*; pub use asm::*;
pub use encode::*; pub use encode::*;
pub use reg::*; pub use reg::*;
pub use test::bin::run as bin_test;
pub struct X86_64; pub struct X86_64;
@@ -1,11 +1,10 @@
use std::{fs::OpenOptions, io::Write, os::unix::fs::OpenOptionsExt, process::Command};
use crate::{ use crate::{
arch::x86_64::*, arch::x86_64::*,
backend::{Instr as BInstr, Program}, backend::{Instr as BInstr, Program},
}; };
use std::{fs::OpenOptions, io::Write, os::unix::fs::OpenOptionsExt, process::Command};
pub fn test_x86_64() { pub fn run() {
let mut program = Program::<X86_64>::default(); let mut program = Program::<X86_64>::default();
let text = b"Hello world!\n"; let text = b"Hello world!\n";
let text_sym = program.ro_data(text); let text_sym = program.ro_data(text);
+5
View File
@@ -0,0 +1,5 @@
pub mod bin;
#[cfg(test)]
mod reg;
#[cfg(test)]
use super::*;
-2
View File
@@ -2,8 +2,6 @@ mod elf;
mod ir; mod ir;
mod link; mod link;
mod test;
pub use ir::*; pub use ir::*;
pub use link::*; pub use link::*;
pub use test::*;
+1 -1
View File
@@ -8,7 +8,7 @@ mod parser;
mod parser_ir; mod parser_ir;
fn main() { fn main() {
return crate::backend::test_x86_64(); return crate::arch::x86_64::bin_test();
let mut args = std::env::args(); let mut args = std::env::args();
let Some(path) = args.nth(1) else { let Some(path) = args.nth(1) else {
println!("file expected"); println!("file expected");