about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <public.oliver.schneider@kit.edu>2017-09-16 13:32:38 +0200
committerOliver Schneider <public.oliver.schneider@kit.edu>2017-09-16 14:02:59 +0200
commitcf925284269a1fbefbf1dfb53c1040c50d5be243 (patch)
tree75846a2a1527f9c6f9c025dc4f65b6074829be81
parent605c82be7a9624e9a5d4f71b6f3ae4fbad8ca001 (diff)
downloadrust-cf925284269a1fbefbf1dfb53c1040c50d5be243.tar.gz
rust-cf925284269a1fbefbf1dfb53c1040c50d5be243.zip
Add windows support
-rw-r--r--appveyor.yml35
-rw-r--r--miri/fn_call.rs6
-rw-r--r--tests/compiletest.rs9
-rw-r--r--tests/run-pass-fullmir/catch.rs1
-rw-r--r--tests/run-pass-fullmir/foreign-fn-linkname.rs3
-rw-r--r--tests/run-pass-fullmir/format.rs1
-rw-r--r--tests/run-pass-fullmir/from_utf8.rs1
-rw-r--r--tests/run-pass-fullmir/hashmap.rs1
-rw-r--r--tests/run-pass-fullmir/heap.rs1
-rw-r--r--tests/run-pass-fullmir/hello.rs1
-rw-r--r--tests/run-pass-fullmir/integer-ops.rs1
-rw-r--r--tests/run-pass-fullmir/issue-15080.rs1
-rw-r--r--tests/run-pass-fullmir/issue-3794.rs1
-rw-r--r--tests/run-pass-fullmir/loop-break-value.rs2
-rw-r--r--tests/run-pass-fullmir/move-arg-2-unique.rs2
-rw-r--r--tests/run-pass-fullmir/regions-mock-trans.rs2
-rw-r--r--tests/run-pass-fullmir/u128.rs2
-rw-r--r--tests/run-pass-fullmir/unsized-tuple-impls.rs2
-rw-r--r--tests/run-pass-fullmir/vecs.rs2
-rw-r--r--tests/run-pass/issue-17877.rs1
20 files changed, 69 insertions, 6 deletions
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000000..6a497193d79
--- /dev/null
+++ b/appveyor.yml
@@ -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
diff --git a/miri/fn_call.rs b/miri/fn_call.rs
index 5285d02b4f0..36d9c0b481f 100644
--- a/miri/fn_call.rs
+++ b/miri/fn_call.rs
@@ -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)),
         }
 
diff --git a/tests/compiletest.rs b/tests/compiletest.rs
index b87fd7d2434..82fc4968a46 100644
--- a/tests/compiletest.rs
+++ b/tests/compiletest.rs
@@ -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]
diff --git a/tests/run-pass-fullmir/catch.rs b/tests/run-pass-fullmir/catch.rs
index efcfee68eef..490f17d4cf4 100644
--- a/tests/run-pass-fullmir/catch.rs
+++ b/tests/run-pass-fullmir/catch.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
 fn main() {
diff --git a/tests/run-pass-fullmir/foreign-fn-linkname.rs b/tests/run-pass-fullmir/foreign-fn-linkname.rs
index b569cd0a662..20cb713590c 100644
--- a/tests/run-pass-fullmir/foreign-fn-linkname.rs
+++ b/tests/run-pass-fullmir/foreign-fn-linkname.rs
@@ -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;
diff --git a/tests/run-pass-fullmir/format.rs b/tests/run-pass-fullmir/format.rs
index 78729b91561..a14d7054e72 100644
--- a/tests/run-pass-fullmir/format.rs
+++ b/tests/run-pass-fullmir/format.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 fn main() {
     println!("Hello {}", 13);
 }
diff --git a/tests/run-pass-fullmir/from_utf8.rs b/tests/run-pass-fullmir/from_utf8.rs
index 69e6c521af6..c5d4abcfdae 100644
--- a/tests/run-pass-fullmir/from_utf8.rs
+++ b/tests/run-pass-fullmir/from_utf8.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 fn main() {
     let _ = ::std::str::from_utf8(b"a");
 }
diff --git a/tests/run-pass-fullmir/hashmap.rs b/tests/run-pass-fullmir/hashmap.rs
index f4a358174f5..99f05e25985 100644
--- a/tests/run-pass-fullmir/hashmap.rs
+++ b/tests/run-pass-fullmir/hashmap.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 use std::collections::{self, HashMap};
 use std::hash::BuildHasherDefault;
 
diff --git a/tests/run-pass-fullmir/heap.rs b/tests/run-pass-fullmir/heap.rs
index b533f916469..917d51d0e4b 100644
--- a/tests/run-pass-fullmir/heap.rs
+++ b/tests/run-pass-fullmir/heap.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 #![feature(box_syntax)]
 
 fn make_box() -> Box<(i16, i16)> {
diff --git a/tests/run-pass-fullmir/hello.rs b/tests/run-pass-fullmir/hello.rs
index e7a11a969c0..986efcaf900 100644
--- a/tests/run-pass-fullmir/hello.rs
+++ b/tests/run-pass-fullmir/hello.rs
@@ -1,3 +1,4 @@
+//ignore-msvc
 fn main() {
     println!("Hello, world!");
 }
diff --git a/tests/run-pass-fullmir/integer-ops.rs b/tests/run-pass-fullmir/integer-ops.rs
index 0964b1b32b5..97c694fd567 100644
--- a/tests/run-pass-fullmir/integer-ops.rs
+++ b/tests/run-pass-fullmir/integer-ops.rs
@@ -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() {
diff --git a/tests/run-pass-fullmir/issue-15080.rs b/tests/run-pass-fullmir/issue-15080.rs
index cee0caeb465..4a84f2bc5d6 100644
--- a/tests/run-pass-fullmir/issue-15080.rs
+++ b/tests/run-pass-fullmir/issue-15080.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//ignore-msvc
 
 #![feature(slice_patterns)]
 
diff --git a/tests/run-pass-fullmir/issue-3794.rs b/tests/run-pass-fullmir/issue-3794.rs
index badb833ee80..8d55af58eec 100644
--- a/tests/run-pass-fullmir/issue-3794.rs
+++ b/tests/run-pass-fullmir/issue-3794.rs
@@ -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 {
diff --git a/tests/run-pass-fullmir/loop-break-value.rs b/tests/run-pass-fullmir/loop-break-value.rs
index 8631909a2a9..8a0ea113c5d 100644
--- a/tests/run-pass-fullmir/loop-break-value.rs
+++ b/tests/run-pass-fullmir/loop-break-value.rs
@@ -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)]
 
diff --git a/tests/run-pass-fullmir/move-arg-2-unique.rs b/tests/run-pass-fullmir/move-arg-2-unique.rs
index d44c83763b7..f3c65662376 100644
--- a/tests/run-pass-fullmir/move-arg-2-unique.rs
+++ b/tests/run-pass-fullmir/move-arg-2-unique.rs
@@ -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)]
 
diff --git a/tests/run-pass-fullmir/regions-mock-trans.rs b/tests/run-pass-fullmir/regions-mock-trans.rs
index 6eeb7cd5117..cef62e47a56 100644
--- a/tests/run-pass-fullmir/regions-mock-trans.rs
+++ b/tests/run-pass-fullmir/regions-mock-trans.rs
@@ -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)]
diff --git a/tests/run-pass-fullmir/u128.rs b/tests/run-pass-fullmir/u128.rs
index a05308acbe6..5b2efdd2051 100644
--- a/tests/run-pass-fullmir/u128.rs
+++ b/tests/run-pass-fullmir/u128.rs
@@ -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 }
diff --git a/tests/run-pass-fullmir/unsized-tuple-impls.rs b/tests/run-pass-fullmir/unsized-tuple-impls.rs
index ccb6883e873..828e5c26927 100644
--- a/tests/run-pass-fullmir/unsized-tuple-impls.rs
+++ b/tests/run-pass-fullmir/unsized-tuple-impls.rs
@@ -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;
 
diff --git a/tests/run-pass-fullmir/vecs.rs b/tests/run-pass-fullmir/vecs.rs
index 776791bbc9b..9a8912a6b98 100644
--- a/tests/run-pass-fullmir/vecs.rs
+++ b/tests/run-pass-fullmir/vecs.rs
@@ -1,3 +1,5 @@
+//ignore-msvc
+
 fn make_vec() -> Vec<u8> {
     let mut v = Vec::with_capacity(4);
     v.push(1);
diff --git a/tests/run-pass/issue-17877.rs b/tests/run-pass/issue-17877.rs
index 6c87e8d35fb..b4b74b9905f 100644
--- a/tests/run-pass/issue-17877.rs
+++ b/tests/run-pass/issue-17877.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//ignore-msvc
 
 #![feature(slice_patterns)]