提交 1241938f 编写于 作者: R Ralf Jung

test suite now also passes on MIR-libstd

Also enable some tests that were disabled for no apparant reason.
(The comment in zst.rs was wrong, the test was disabled also for miri execution.)
Delete env_args test as the args can actually be queried with MIR-libstd (currently, they are always empty)
上级 99433a1f
......@@ -34,7 +34,7 @@ pub fn step(&mut self) -> EvalResult<'tcx, bool> {
if self.stack.is_empty() {
if let Some((instance, ptr)) = self.memory.fetch_tls_dtor() {
trace!("Running TLS dtor {:?} on {:?}", instance, ptr);
// TODO: Potientiually, this has to support all the other possible instances? See eval_fn_call in terminator/mod.rs
// TODO: Potientially, this has to support all the other possible instances? See eval_fn_call in terminator/mod.rs
let mir = self.load_mir(instance.def)?;
self.push_stack_frame(
instance,
......
......@@ -622,6 +622,10 @@ fn call_c_abi(
return Ok(());
}
"__rust_start_panic" => {
return Err(EvalError::Panic);
}
"memcmp" => {
let left = args[0].read_ptr(&self.memory)?;
let right = args[1].read_ptr(&self.memory)?;
......
fn main() {
let x = std::env::args(); //~ ERROR miri does not support program arguments
assert_eq!(x.count(), 1);
}
#![feature(custom_attribute, attr_literals)]
#![miri(memory_size=20)]
#![miri(memory_size=4095)]
fn main() {
let _x = [42; 10];
//~^ERROR tried to allocate 40 more bytes, but only
let _x = [42; 1024];
//~^ERROR tried to allocate 4096 more bytes, but only
}
#![feature(box_syntax, custom_attribute, attr_literals)]
#![miri(memory_size=1000)]
#![miri(memory_size=2048)]
fn main() {
loop {
......
#![feature(custom_attribute, attr_literals)]
#![miri(stack_limit=2)]
#![miri(stack_limit=16)]
fn bar() {
foo();
......@@ -10,10 +10,16 @@ fn foo() {
}
fn cake() {
flubber();
flubber(3);
}
fn flubber() {}
fn flubber(i: u32) {
if i > 0 {
flubber(i-1);
} else {
bar();
}
}
fn main() {
bar();
......
// aux-build:dep.rs
// ignore-cross-compile
extern crate dep;
......
fn main() {
println!("Hello, world!");
}
// the following flag prevents this test from running on the host machine
// this should only be run on miri, because rust doesn't (yet?) optimize ZSTs of different types
// into the same memory location
// ignore-test
#[derive(PartialEq, Debug)]
struct A;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册