Add windows support
This commit is contained in:
parent
605c82be7a
commit
cf92528426
20 changed files with 69 additions and 6 deletions
35
appveyor.yml
Normal file
35
appveyor.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
environment:
|
||||
global:
|
||||
PROJECT_NAME: miri
|
||||
matrix:
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
MSYS2_BITS: 32
|
||||
- TARGET: x86_64-pc-windows-msvc
|
||||
MSYS2_BITS: 64
|
||||
|
||||
install:
|
||||
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
|
||||
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
|
||||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly
|
||||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin;C:\Users\appveyor\.rustup\toolchains\nightly-%TARGET%\bin
|
||||
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
|
||||
- rustc -V
|
||||
- cargo -V
|
||||
- rustup component add rust-src
|
||||
- cargo install --git https://github.com/japaric/xargo.git
|
||||
- cd xargo
|
||||
- set RUSTFLAGS=-Zalways-encode-mir -Zmir-emit-validate=1
|
||||
- xargo build
|
||||
- set RUSTFLAGS=
|
||||
- cd ..
|
||||
|
||||
build: false
|
||||
|
||||
test_script:
|
||||
- set RUST_BACKTRACE=1
|
||||
- cargo build
|
||||
- cargo test
|
||||
|
||||
notifications:
|
||||
- provider: Email
|
||||
on_build_success: false
|
||||
|
|
@ -634,6 +634,12 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator>
|
|||
let bool = self.tcx.types.bool;
|
||||
self.write_primval(dest, PrimVal::from_bool(false), bool)?;
|
||||
}
|
||||
"std::sys::imp::c::::AddVectoredExceptionHandler" |
|
||||
"std::sys::imp::c::::SetThreadStackGuarantee" => {
|
||||
let usize = self.tcx.types.usize;
|
||||
// any non zero value works for the stdlib. This is just used for stackoverflows anyway
|
||||
self.write_primval(dest, PrimVal::Bytes(1), usize)?;
|
||||
},
|
||||
_ => return err!(NoMirFor(path)),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
|
|||
// skip fullmir on nonhost
|
||||
return;
|
||||
}
|
||||
let sysroot = Path::new(&std::env::var("HOME").unwrap())
|
||||
let sysroot = std::env::home_dir().unwrap()
|
||||
.join(".xargo")
|
||||
.join("HOST");
|
||||
config.target_rustcflags = Some(format!("--sysroot {}", sysroot.to_str().unwrap()));
|
||||
|
|
@ -110,9 +110,10 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) {
|
|||
// skip fullmir on nonhost
|
||||
return;
|
||||
}
|
||||
let sysroot = Path::new(&std::env::var("HOME").unwrap())
|
||||
let sysroot = std::env::home_dir().unwrap()
|
||||
.join(".xargo")
|
||||
.join("HOST");
|
||||
|
||||
flags.push(format!("--sysroot {}", sysroot.to_str().unwrap()));
|
||||
}
|
||||
if opt {
|
||||
|
|
@ -192,9 +193,9 @@ fn run_pass_miri_noopt() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
|
||||
fn run_pass_miri_opt() {
|
||||
// FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
|
||||
//run_pass_miri(true);
|
||||
run_pass_miri(true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
|
||||
//ignore-msvc
|
||||
#![feature(libc)]
|
||||
|
||||
extern crate libc;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
fn main() {
|
||||
println!("Hello {}", 13);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
fn main() {
|
||||
let _ = ::std::str::from_utf8(b"a");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
use std::collections::{self, HashMap};
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
#![feature(box_syntax)]
|
||||
|
||||
fn make_box() -> Box<(i16, i16)> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//ignore-msvc
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
// FIXME: remove -Zmir-opt-level once https://github.com/rust-lang/rust/issues/43359 is fixed
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
//ignore-msvc
|
||||
use std::i32;
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(slice_patterns)]
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
#![feature(box_syntax)]
|
||||
|
||||
trait T {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(unreachable_code)]
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![allow(unused_features, unused_variables)]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
// FIXME: We handle uninitialzied storage here, which currently makes validation fail.
|
||||
// compile-flags: -Zmir-emit-validate=0
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(libc)]
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(i128_type)]
|
||||
|
||||
fn b<T>(t: T) -> T { t }
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(unsized_tuple_coercion)]
|
||||
use std::mem;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
//ignore-msvc
|
||||
|
||||
fn make_vec() -> Vec<u8> {
|
||||
let mut v = Vec::with_capacity(4);
|
||||
v.push(1);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//ignore-msvc
|
||||
|
||||
#![feature(slice_patterns)]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue