2016-06-17 23:35:34 -05:00
|
|
|
#![feature(test, rustc_private)]
|
2016-05-30 06:40:20 -05:00
|
|
|
|
|
|
|
extern crate test;
|
2018-11-17 05:24:27 -06:00
|
|
|
use crate::test::Bencher;
|
2016-06-17 23:35:34 -05:00
|
|
|
mod helpers;
|
2018-11-17 05:24:27 -06:00
|
|
|
use crate::helpers::*;
|
2016-05-30 06:40:20 -05:00
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn noop(bencher: &mut Bencher) {
|
2017-08-10 10:48:38 -05:00
|
|
|
bencher.iter(|| { smoke_helper::main(); })
|
2016-05-30 06:40:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
// really slow
|
|
|
|
#[bench]
|
|
|
|
fn noop_miri_full(bencher: &mut Bencher) {
|
|
|
|
let path = std::env::var("RUST_SYSROOT").expect("env variable `RUST_SYSROOT` not set");
|
|
|
|
bencher.iter(|| {
|
|
|
|
let mut process = std::process::Command::new("target/release/miri");
|
|
|
|
process.arg("benches/smoke_helper.rs")
|
|
|
|
.arg("--sysroot").arg(&path);
|
|
|
|
let output = process.output().unwrap();
|
|
|
|
if !output.status.success() {
|
|
|
|
println!("{}", String::from_utf8(output.stdout).unwrap());
|
|
|
|
println!("{}", String::from_utf8(output.stderr).unwrap());
|
|
|
|
panic!("failed to run miri");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn noop_miri_interpreter(bencher: &mut Bencher) {
|
2016-05-30 07:05:50 -05:00
|
|
|
miri_helper::run("smoke_helper", bencher);
|
2016-05-30 06:40:20 -05:00
|
|
|
}
|