move x86_64 bin test
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
mod asm;
|
||||
mod encode;
|
||||
mod reg;
|
||||
#[cfg(test)]
|
||||
mod test;
|
||||
|
||||
use crate::{
|
||||
@@ -13,6 +12,7 @@ use crate::{
|
||||
pub use asm::*;
|
||||
pub use encode::*;
|
||||
pub use reg::*;
|
||||
pub use test::bin::run as bin_test;
|
||||
|
||||
pub struct X86_64;
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
use std::{fs::OpenOptions, io::Write, os::unix::fs::OpenOptionsExt, process::Command};
|
||||
|
||||
use crate::{
|
||||
arch::x86_64::*,
|
||||
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 text = b"Hello world!\n";
|
||||
let text_sym = program.ro_data(text);
|
||||
@@ -0,0 +1,5 @@
|
||||
pub mod bin;
|
||||
#[cfg(test)]
|
||||
mod reg;
|
||||
#[cfg(test)]
|
||||
use super::*;
|
||||
@@ -2,8 +2,6 @@ mod elf;
|
||||
|
||||
mod ir;
|
||||
mod link;
|
||||
mod test;
|
||||
|
||||
pub use ir::*;
|
||||
pub use link::*;
|
||||
pub use test::*;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ mod parser;
|
||||
mod parser_ir;
|
||||
|
||||
fn main() {
|
||||
return crate::backend::test_x86_64();
|
||||
return crate::arch::x86_64::bin_test();
|
||||
let mut args = std::env::args();
|
||||
let Some(path) = args.nth(1) else {
|
||||
println!("file expected");
|
||||
|
||||
Reference in New Issue
Block a user