mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 15:08:52 +00:00
Update skeleton
This commit is contained in:
18
bin/fuzz.rs
18
bin/fuzz.rs
@@ -2,10 +2,8 @@
|
||||
extern crate clap;
|
||||
use clap::{crate_authors, crate_description, crate_version, App};
|
||||
|
||||
#[macro_use]
|
||||
extern crate kecc;
|
||||
|
||||
use kecc::{Parse, Translate};
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
@@ -18,15 +16,19 @@ fn main() {
|
||||
.get_matches();
|
||||
|
||||
let input = matches.value_of("INPUT").unwrap();
|
||||
let unit = ok_or_exit!(Parse::default().translate(&input), 1);
|
||||
|
||||
if matches.is_present("print") {
|
||||
kecc::test_write_c(&unit, Path::new(&input));
|
||||
kecc::test_write_c(Path::new(&input));
|
||||
return;
|
||||
}
|
||||
|
||||
if matches.is_present("irgen") {
|
||||
kecc::test_irgen(&unit, Path::new(&input));
|
||||
kecc::test_irgen(Path::new(&input));
|
||||
return;
|
||||
}
|
||||
|
||||
if matches.is_present("irparse") {
|
||||
kecc::test_irparse(Path::new(&input));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,5 +48,9 @@ fn main() {
|
||||
todo!("test gvn");
|
||||
}
|
||||
|
||||
kecc::test_asmgen(&unit, Path::new(&input));
|
||||
assert_eq!(
|
||||
Path::new(input).extension(),
|
||||
Some(std::ffi::OsStr::new("ir"))
|
||||
);
|
||||
kecc::test_asmgen(Path::new(&input));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user