]> git.lizzy.rs Git - rust.git/commitdiff
Enable the overflow-related tests for MIR
authorJames Miller <james@aatch.net>
Thu, 28 Apr 2016 12:08:01 +0000 (00:08 +1200)
committerEduard Burtescu <edy.burt@gmail.com>
Sun, 5 Jun 2016 11:02:24 +0000 (14:02 +0300)
20 files changed:
src/test/compile-fail/const-err.rs
src/test/compile-fail/const-eval-overflow.rs
src/test/run-fail/divide-by-zero.rs
src/test/run-fail/mod-zero.rs
src/test/run-fail/overflowing-add.rs
src/test/run-fail/overflowing-lsh-1.rs
src/test/run-fail/overflowing-lsh-2.rs
src/test/run-fail/overflowing-lsh-3.rs
src/test/run-fail/overflowing-lsh-4.rs
src/test/run-fail/overflowing-mul.rs
src/test/run-fail/overflowing-neg.rs
src/test/run-fail/overflowing-rsh-1.rs
src/test/run-fail/overflowing-rsh-2.rs
src/test/run-fail/overflowing-rsh-3.rs
src/test/run-fail/overflowing-rsh-4.rs
src/test/run-fail/overflowing-rsh-5.rs
src/test/run-fail/overflowing-rsh-6.rs
src/test/run-fail/overflowing-sub.rs
src/test/run-make/debug-assertions/debug.rs
src/test/run-pass/issue-8460.rs

index a25255c010caf4c5bb6f938d6c52c9882704af30..85d67f52bfe8647040d538455c399c356598d417 100644 (file)
@@ -11,7 +11,6 @@
 // these errors are not actually "const_err", they occur in trans/consts
 // and are unconditional warnings that can't be denied or allowed
 
-#![feature(rustc_attrs)]
 #![allow(exceeding_bitshifts)]
 #![allow(const_err)]
 
@@ -24,7 +23,6 @@ fn black_box<T>(_: T) {
 //~^ ERROR array index out of bounds
 //~^^ ERROR array index out of bounds
 
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let a = -std::i8::MIN;
     //~^ WARN attempted to negate with overflow
index 96013551ef4927ea17028eaa21e2ae96b31dafde..3dfcb5bb29a24a68701b48d195f62aca3361240c 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_attrs)]
 #![allow(unused_imports)]
 
 // Note: the relevant lint pass here runs before some of the constant
      //~^ ERROR attempted to multiply with overflow
      );
 
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     foo(VALS_I8);
     foo(VALS_I16);
index d3817b25d6100f6d364ec3515c20102ad0e7b665..3d9bee3c86a569fe8bc6691925afa1c04e2c3cd1 100644 (file)
@@ -12,8 +12,6 @@
 
 // error-pattern:attempted to divide by zero
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let y = 0;
     let _z = 1 / y;
index 7a151c8c572f6dfe7db13bf5576f34e1c9a1acb5..093dad5838b60cbd7f8499c1d0135b1c5fd46190 100644 (file)
@@ -12,8 +12,6 @@
 
 // error-pattern:attempted remainder with a divisor of zero
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let y = 0;
     let _z = 1 % y;
index 26cc9eda04634d2ec8d49ae73048f78c82a5038b..1f5297de5aa8d46bc592a745b435710572163643 100644 (file)
@@ -14,8 +14,6 @@
 // compile-flags: -C debug-assertions
 
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 200u8 + 200u8 + 200u8;
 }
index 4648f5c9c79d502db564f1318935a8b133703000..a6a898fef19976f46539fc52b409125d341421fe 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1_i32 << 32;
 }
index 12741864eda9e80bed623d3e4702001e304cf9f3..d25982e60165249468f43da0a9123c022f7b7f1b 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1 << -1;
 }
index 76e029bab5219c89f7593f148dc80e11b7f0915c..0d9fcc850bbb0d866f47208f09f3bc7f60d0a325 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1_u64 << 64;
 }
index a9ee4b882532b1326bfae28ae1d40ab9c686b837..f8dbd41d8bb00a79f316ca80dd74eb9016a6034e 100644 (file)
@@ -18,8 +18,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     // this signals overflow when checking is on
     let x = 1_i8 << 17;
index 179622e49a6287ffa45bd31d53b5c802b328484b..ce8a8c27e52c92fc7e4ee7770691f1cf34dc6d01 100644 (file)
@@ -13,8 +13,6 @@
 // error-pattern:thread 'main' panicked at 'arithmetic operation overflowed'
 // compile-flags: -C debug-assertions
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let x = 200u8 * 4;
 }
index 2bc625f692e53449e1e18ee6a891a097e2d83467..84e41ea848809b2ff82637112cba4e0682879500 100644 (file)
@@ -13,8 +13,6 @@
 // error-pattern:thread 'main' panicked at 'attempted to negate with overflow'
 // compile-flags: -C debug-assertions
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -std::i8::MIN;
 }
index d37ea693a9fcf382627ea7a44be462c17737bc08..964005413674425a4f1b45c26f3f133753b4070e 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i32 >> 32;
 }
index a4b7028a474dc97f4406140ddf9194a4674cf1dd..c8c7171d7ad5728f6e34fc877e5513858c8474a2 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i32 >> -1;
 }
index 199da59eb53fd2336745e1d37e1858a022b57221..afcf31f5d69b597d50ab2623b058cb614a063ce2 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i64 >> 64;
 }
index d0d89a310e26b7e78db0a68c6459eb522cfaaef0..c4b3d61f2af48b7de8c669922f99f4b7cc0f9720 100644 (file)
@@ -18,8 +18,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     // this signals overflow when checking is on
     let x = 2_i8 >> 17;
index 03588c3576ad3952883991555a431f27542148e0..8793a416286e309ed3999bf0597282bde4db12a5 100644 (file)
@@ -15,8 +15,6 @@
 
 #![warn(exceeding_bitshifts)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _n = 1i64 >> [64][0];
 }
index 914f6d2b5c4ce0115ecd29bea95b5e9e31200cc6..e9676b6f702990cba0564d12ee41c96e2941023f 100644 (file)
@@ -16,8 +16,6 @@
 #![warn(exceeding_bitshifts)]
 #![feature(const_indexing)]
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _n = 1i64 >> [64][0];
 }
index 7eec7699d99c4d102d976f23398dcd2f3809ef99..96775aef078360259b92c471467bc148d0ef43df 100644 (file)
@@ -13,8 +13,6 @@
 // error-pattern:thread 'main' panicked at 'arithmetic operation overflowed'
 // compile-flags: -C debug-assertions
 
-#![feature(rustc_attrs)]
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 42u8 - (42u8 + 1);
 }
index fb54161c2c127db8dafd85cd069a9905bc173a89..65682cb86c36881c1ddaca9a586f469d3b97337f 100644 (file)
@@ -37,7 +37,6 @@ fn debug_assert() {
 }
 
 fn overflow() {
-    #[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
     fn add(a: u8, b: u8) -> u8 { a + b }
 
     add(200u8, 200u8);
index 7589bce31f480ca7faeb98051748ee4878a82777..8d15fe30a1b07dd9116bc5adee951cebfa9ceb13 100644 (file)
 macro_rules! check {
     ($($e:expr),*) => {
         $(assert!(thread::spawn({
-            #[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
             move|| { $e; }
         }).join().is_err());)*
     }
 }
 
-#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     check![
         isize::min_value() / -1,