From 20c2e0bede0877abe79dda162922ec8c267105fe Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 19 Jul 2017 15:06:21 +0200 Subject: [PATCH] Test miri on mac os --- .travis.yml | 9 +++++++++ src/fn_call.rs | 11 +++++++++-- tests/run-pass-fullmir/catch.rs | 1 + tests/run-pass-fullmir/format.rs | 1 + tests/run-pass-fullmir/hello.rs | 1 + tests/run-pass-fullmir/issue-3794.rs | 1 + 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 360b741106e5..6a987f93748c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,17 @@ language: rust cache: cargo + +os: +- osx +- linux + rust: - nightly before_script: +# mac os weirdness (https://github.com/travis-ci/travis-ci/issues/6307) +- curl -sSL https://rvm.io/mpapis.asc | gpg --import - +- rvm get stable +# actual travis code - export PATH=$HOME/.local/bin:$PATH - rustup target add i686-unknown-linux-gnu - rustup target add i686-pc-windows-gnu diff --git a/src/fn_call.rs b/src/fn_call.rs index c862238e889c..2b4e7b736628 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -531,9 +531,10 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' // Return success (0) self.write_null(dest, dest_ty)?; } + "_tlv_atexit" => { - // TODO: handle it - } + return err!(Unimplemented("can't interpret with full mir for osx target".to_owned())); + }, // Stub out all the other pthread calls to just return 0 link_name if link_name.starts_with("pthread_") => { @@ -541,6 +542,12 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' self.write_null(dest, dest_ty)?; } + "mmap" => { + // This is a horrible hack, but well... the guard page mechanism calls mmap and expects a particular return value, so we give it that value + let addr = self.into_ptr(args[0].value)?; + self.write_ptr(dest, addr, dest_ty)?; + } + _ => { return err!(Unimplemented( format!("can't call C ABI function: {}", link_name), diff --git a/tests/run-pass-fullmir/catch.rs b/tests/run-pass-fullmir/catch.rs index 490f17d4cf4f..60c86c99e9aa 100644 --- a/tests/run-pass-fullmir/catch.rs +++ b/tests/run-pass-fullmir/catch.rs @@ -1,4 +1,5 @@ //ignore-msvc +//ignore-macos use std::panic::{catch_unwind, AssertUnwindSafe}; fn main() { diff --git a/tests/run-pass-fullmir/format.rs b/tests/run-pass-fullmir/format.rs index a14d7054e729..59af803b59f0 100644 --- a/tests/run-pass-fullmir/format.rs +++ b/tests/run-pass-fullmir/format.rs @@ -1,4 +1,5 @@ //ignore-msvc +//ignore-macos fn main() { println!("Hello {}", 13); } diff --git a/tests/run-pass-fullmir/hello.rs b/tests/run-pass-fullmir/hello.rs index 986efcaf9005..a0d73733bdfc 100644 --- a/tests/run-pass-fullmir/hello.rs +++ b/tests/run-pass-fullmir/hello.rs @@ -1,4 +1,5 @@ //ignore-msvc +//ignore-macos fn main() { println!("Hello, world!"); } diff --git a/tests/run-pass-fullmir/issue-3794.rs b/tests/run-pass-fullmir/issue-3794.rs index 8d55af58eeca..8b653f0f95fc 100644 --- a/tests/run-pass-fullmir/issue-3794.rs +++ b/tests/run-pass-fullmir/issue-3794.rs @@ -9,6 +9,7 @@ // except according to those terms. //ignore-msvc +//ignore-macos #![feature(box_syntax)] trait T {