Skip to content

Commit 80853e2

Browse files
authored
Merge pull request rust-lang#334 from solson/windows
Windows support in the test suite + appveyor
2 parents 8bddd6a + 0320a77 commit 80853e2

20 files changed

+69
-6
lines changed

appveyor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
environment:
2+
global:
3+
PROJECT_NAME: miri
4+
matrix:
5+
- TARGET: i686-pc-windows-msvc
6+
MSYS2_BITS: 32
7+
- TARGET: x86_64-pc-windows-msvc
8+
MSYS2_BITS: 64
9+
10+
install:
11+
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
12+
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
13+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly
14+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin;C:\Users\appveyor\.rustup\toolchains\nightly-%TARGET%\bin
15+
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
16+
- rustc -V
17+
- cargo -V
18+
- rustup component add rust-src
19+
- cargo install --git https://github.com/japaric/xargo.git
20+
- cd xargo
21+
- set RUSTFLAGS=-Zalways-encode-mir -Zmir-emit-validate=1
22+
- xargo build
23+
- set RUSTFLAGS=
24+
- cd ..
25+
26+
build: false
27+
28+
test_script:
29+
- set RUST_BACKTRACE=1
30+
- cargo build --locked --release
31+
- cargo test --locked --release
32+
33+
notifications:
34+
- provider: Email
35+
on_build_success: false

miri/fn_call.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator>
634634
let bool = self.tcx.types.bool;
635635
self.write_primval(dest, PrimVal::from_bool(false), bool)?;
636636
}
637+
"std::sys::imp::c::::AddVectoredExceptionHandler" |
638+
"std::sys::imp::c::::SetThreadStackGuarantee" => {
639+
let usize = self.tcx.types.usize;
640+
// any non zero value works for the stdlib. This is just used for stackoverflows anyway
641+
self.write_primval(dest, PrimVal::Bytes(1), usize)?;
642+
},
637643
_ => return err!(NoMirFor(path)),
638644
}
639645

tests/compiletest.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
5050
// skip fullmir on nonhost
5151
return;
5252
}
53-
let sysroot = Path::new(&std::env::var("HOME").unwrap())
53+
let sysroot = std::env::home_dir().unwrap()
5454
.join(".xargo")
5555
.join("HOST");
5656
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) {
110110
// skip fullmir on nonhost
111111
return;
112112
}
113-
let sysroot = Path::new(&std::env::var("HOME").unwrap())
113+
let sysroot = std::env::home_dir().unwrap()
114114
.join(".xargo")
115115
.join("HOST");
116+
116117
flags.push(format!("--sysroot {}", sysroot.to_str().unwrap()));
117118
}
118119
if opt {
@@ -189,9 +190,9 @@ fn run_pass_miri_noopt() {
189190
}
190191

191192
#[test]
193+
#[ignore] // FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
192194
fn run_pass_miri_opt() {
193-
// FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
194-
//run_pass_miri(true);
195+
run_pass_miri(true);
195196
}
196197

197198
#[test]

tests/run-pass-fullmir/catch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
use std::panic::{catch_unwind, AssertUnwindSafe};
23

34
fn main() {

tests/run-pass-fullmir/foreign-fn-linkname.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
12-
11+
//ignore-msvc
1312
#![feature(libc)]
1413

1514
extern crate libc;

tests/run-pass-fullmir/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
fn main() {
23
println!("Hello {}", 13);
34
}

tests/run-pass-fullmir/from_utf8.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
fn main() {
23
let _ = ::std::str::from_utf8(b"a");
34
}

tests/run-pass-fullmir/hashmap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
use std::collections::{self, HashMap};
23
use std::hash::BuildHasherDefault;
34

tests/run-pass-fullmir/heap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
#![feature(box_syntax)]
23

34
fn make_box() -> Box<(i16, i16)> {

tests/run-pass-fullmir/hello.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//ignore-msvc
12
fn main() {
23
println!("Hello, world!");
34
}

tests/run-pass-fullmir/integer-ops.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// FIXME: remove -Zmir-opt-level once https://github.com/rust-lang/rust/issues/43359 is fixed
1212
// compile-flags: -Zmir-opt-level=0
1313

14+
//ignore-msvc
1415
use std::i32;
1516

1617
pub fn main() {

tests/run-pass-fullmir/issue-15080.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
1112

1213
#![feature(slice_patterns)]
1314

tests/run-pass-fullmir/issue-3794.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
1112
#![feature(box_syntax)]
1213

1314
trait T {

tests/run-pass-fullmir/loop-break-value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
12+
1113
#![feature(never_type)]
1214
#![allow(unreachable_code)]
1315

tests/run-pass-fullmir/move-arg-2-unique.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
12+
1113
#![allow(unused_features, unused_variables)]
1214
#![feature(box_syntax)]
1315

tests/run-pass-fullmir/regions-mock-trans.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// FIXME: We handle uninitialzied storage here, which currently makes validation fail.
1212
// compile-flags: -Zmir-emit-validate=0
1313

14+
//ignore-msvc
15+
1416
#![feature(libc)]
1517

1618
#![allow(dead_code)]

tests/run-pass-fullmir/u128.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
12+
1113
#![feature(i128_type)]
1214

1315
fn b<T>(t: T) -> T { t }

tests/run-pass-fullmir/unsized-tuple-impls.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
12+
1113
#![feature(unsized_tuple_coercion)]
1214
use std::mem;
1315

tests/run-pass-fullmir/vecs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//ignore-msvc
2+
13
fn make_vec() -> Vec<u8> {
24
let mut v = Vec::with_capacity(4);
35
v.push(1);

tests/run-pass/issue-17877.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//ignore-msvc
1112

1213
#![feature(slice_patterns)]
1314

0 commit comments

Comments
 (0)