]> git.lizzy.rs Git - rust.git/commitdiff
Add #[rustc_no_mir] to make tests pass with -Z orbit.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 10 Mar 2016 19:20:09 +0000 (21:20 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Thu, 17 Mar 2016 20:48:07 +0000 (22:48 +0200)
45 files changed:
src/compiletest/runtest.rs
src/libcore/lib.rs
src/libcore/num/mod.rs
src/libstd/lib.rs
src/libstd/num/f32.rs
src/libstd/num/f64.rs
src/test/codegen/adjustments.rs
src/test/codegen/coercions.rs
src/test/codegen/consts.rs
src/test/codegen/drop.rs
src/test/codegen/refs.rs
src/test/codegen/stores.rs
src/test/compile-fail/const-err.rs
src/test/compile-fail/const-eval-overflow.rs
src/test/compile-fail/intrinsic-return-address.rs
src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs
src/test/compile-fail/simd-intrinsic-generic-cast.rs
src/test/compile-fail/simd-intrinsic-generic-comparison.rs
src/test/compile-fail/simd-intrinsic-generic-elements.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-valgrind/cast-enum-with-dtor.rs
src/test/run-pass/backtrace-debuginfo-aux.rs
src/test/run-pass/backtrace-debuginfo.rs
src/test/run-pass/const-str-ptr.rs
src/test/run-pass/issue-23338-ensure-param-drop-order.rs
src/test/run-pass/issue-8460.rs
src/test/run-pass/mir_raw_fat_ptr.rs
src/test/run-pass/simd-intrinsic-generic-elements.rs
src/test/run-pass/zero-size-type-destructors.rs

index 1d1f5489c48f304ffe23838515f0aeaa17eda68d..943d7d4d9bd3a3a0248ca69bdbcca538ecf4b35b 100644 (file)
@@ -863,12 +863,28 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
         "-g".to_owned(),
         "--debuginfo".to_owned()
     ];
-    let new_options =
+    let mut new_options =
         split_maybe_args(options).into_iter()
                                  .filter(|x| !options_to_remove.contains(x))
-                                 .collect::<Vec<String>>()
-                                 .join(" ");
-    Some(new_options)
+                                 .collect::<Vec<String>>();
+
+    let mut i = 0;
+    while i + 1 < new_options.len() {
+        if new_options[i] == "-Z" {
+            // FIXME #31005 MIR missing debuginfo currently.
+            if new_options[i + 1] == "orbit" {
+                // Remove "-Z" and "orbit".
+                new_options.remove(i);
+                new_options.remove(i);
+                continue;
+            }
+            // Always skip over -Z's argument.
+            i += 1;
+        }
+        i += 1;
+    }
+
+    Some(new_options.join(" "))
 }
 
 fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String]) {
index f76b8655ad1ed1389f555999bee3c4d63b95f395..13d3f42ba18968dd53d5dc3db97db3f62db6cacb 100644 (file)
@@ -72,6 +72,7 @@
 #![feature(reflect)]
 #![feature(unwind_attributes)]
 #![feature(repr_simd, platform_intrinsics)]
+#![feature(rustc_attrs)]
 #![feature(staged_api)]
 #![feature(unboxed_closures)]
 
index 5a2a043d6f1b8ce7ae0a38054e6d1267d0825ac7..e6f83498ab1e2638dbd90b4cdc56c6c2c33a924d 100644 (file)
@@ -1008,6 +1008,7 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
         #[inline]
+        #[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
         pub fn pow(self, mut exp: u32) -> Self {
             let mut base = self;
             let mut acc = Self::one();
@@ -1049,6 +1050,7 @@ pub fn pow(self, mut exp: u32) -> Self {
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
         #[inline]
+        #[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
         pub fn abs(self) -> Self {
             if self.is_negative() {
                 // Note that the #[inline] above means that the overflow
@@ -2013,6 +2015,7 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
         #[inline]
+        #[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
         pub fn pow(self, mut exp: u32) -> Self {
             let mut base = self;
             let mut acc = Self::one();
index cd0e3a030bd31d6f92ebfbcdb433afd1c08ba3e1..85e48f85d3d901591e24d2e52930799c781e97d4 100644 (file)
 #![feature(raw)]
 #![feature(repr_simd)]
 #![feature(reflect_marker)]
+#![feature(rustc_attrs)]
 #![feature(shared)]
 #![feature(slice_bytes)]
 #![feature(slice_concat_ext)]
index 3705302592432cc192e610571d8caadf4f8856a2..e78d46b22e9409ac2332d9281745544705bfd022 100644 (file)
@@ -1371,6 +1371,7 @@ fn test_classify() {
     }
 
     #[test]
+    #[rustc_no_mir] // FIXME #27840 MIR NAN ends up negative.
     fn test_integer_decode() {
         assert_eq!(3.14159265359f32.integer_decode(), (13176795, -22, 1));
         assert_eq!((-8573.5918555f32).integer_decode(), (8779358, -10, -1));
index 446e22a20ad7d576dc8cd18cb75b06cc0a69d92d..cea5a9edd680be281b3ea09f5428549fda74ec94 100644 (file)
@@ -1264,6 +1264,7 @@ fn test_classify() {
     }
 
     #[test]
+    #[rustc_no_mir] // FIXME #27840 MIR NAN ends up negative.
     fn test_integer_decode() {
         assert_eq!(3.14159265359f64.integer_decode(), (7074237752028906, -51, 1));
         assert_eq!((-8573.5918555f64).integer_decode(), (4713381968463931, -39, -1));
index a61fa84398e9aacbd9b8f1958ec2dc71875368c7..20d049394345256dad72cc965d5d1c670b1f0f12 100644 (file)
@@ -11,6 +11,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 // Hack to get the correct size for the length part in slices
 // CHECK: @helper([[USIZE:i[0-9]+]])
@@ -20,6 +21,7 @@ fn helper(_: usize) {
 
 // CHECK-LABEL: @no_op_slice_adjustment
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn no_op_slice_adjustment(x: &[u8]) -> &[u8] {
     // We used to generate an extra alloca and memcpy for the block's trailing expression value, so
     // check that we copy directly to the return value slot
index c8c9f5b407c421b11458d6b6c514f54ac64afbaf..74c7192259ac4044108f287b39fb09114773b5eb 100644 (file)
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 static X: i32 = 5;
 
 // CHECK-LABEL: @raw_ptr_to_raw_ptr_noop
 // CHECK-NOT: alloca
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn raw_ptr_to_raw_ptr_noop() -> *const i32{
     &X as *const i32
 }
@@ -24,6 +26,7 @@ pub fn raw_ptr_to_raw_ptr_noop() -> *const i32{
 // CHECK-LABEL: @reference_to_raw_ptr_noop
 // CHECK-NOT: alloca
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn reference_to_raw_ptr_noop() -> *const i32 {
     &X
 }
index 6b4e626df924bf020be2e9d5d6e8ebb201bfc765..ea4c932d43549ce74efb7c6204950922d473e01a 100644 (file)
@@ -11,6 +11,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 // Below, these constants are defined as enum variants that by itself would
 // have a lower alignment than the enum type. Ensure that we mark them
@@ -39,18 +40,21 @@ pub enum E<A, B> {
 
 // CHECK-LABEL: @static_enum_const
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn static_enum_const() -> E<i16, i32> {
    STATIC
 }
 
 // CHECK-LABEL: @inline_enum_const
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn inline_enum_const() -> E<i8, i16> {
     E::A(0)
 }
 
 // CHECK-LABEL: @low_align_const
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn low_align_const() -> E<i16, [i16; 3]> {
 // Check that low_align_const and high_align_const use the same constant
 // CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{[0-9]+}}, i8* {{.*}} [[LOW_HIGH:@const[0-9]+]]
@@ -59,6 +63,7 @@ pub fn inline_enum_const() -> E<i8, i16> {
 
 // CHECK-LABEL: @high_align_const
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn high_align_const() -> E<i16, i32> {
 // Check that low_align_const and high_align_const use the same constant
 // CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{[0-9]}}, i8* {{.*}} [[LOW_HIGH]]
index 2ac8de6d802947e3fc43c899b0c6513699c45702..83dd6a3b00258ec5ee4af95d2ff11877cf98cc73 100644 (file)
@@ -11,6 +11,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 struct SomeUniqueName;
 
@@ -24,6 +25,7 @@ pub fn possibly_unwinding() {
 
 // CHECK-LABEL: @droppy
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn droppy() {
 // Check that there are exactly 6 drop calls. The cleanups for the unwinding should be reused, so
 // that's one new drop call per call to possibly_unwinding(), and finally 3 drop calls for the
index 08eec0045f78a07631b52149568e07078ffd3449..36c83412e4f0f4775d73e65356841c27b6f86aa4 100644 (file)
@@ -11,6 +11,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 // Hack to get the correct size for the length part in slices
 // CHECK: @helper([[USIZE:i[0-9]+]])
@@ -20,6 +21,7 @@ fn helper(_: usize) {
 
 // CHECK-LABEL: @ref_dst
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn ref_dst(s: &[u8]) {
     // We used to generate an extra alloca and memcpy to ref the dst, so check that we copy
     // directly to the alloca for "x"
index 46e4c5f341be86c9d395c780b8c02b6e051b3913..f849a6c9b18b847b0ec491c51331484e8feccb5c 100644 (file)
@@ -11,6 +11,7 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
+#![feature(rustc_attrs)]
 
 pub struct Bytes {
   a: u8,
@@ -23,6 +24,7 @@ pub struct Bytes {
 // The array is stored as i32, but its alignment is lower, go with 1 byte to avoid target
 // dependent alignment
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
 // CHECK: [[VAR:%[0-9]+]] = bitcast [4 x i8]* %y to i32*
 // CHECK: store i32 %{{.*}}, i32* [[VAR]], align 1
@@ -33,6 +35,7 @@ pub struct Bytes {
 // The struct is stored as i32, but its alignment is lower, go with 1 byte to avoid target
 // dependent alignment
 #[no_mangle]
+#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn small_struct_alignment(x: &mut Bytes, y: Bytes) {
 // CHECK: [[VAR:%[0-9]+]] = bitcast %Bytes* %y to i32*
 // CHECK: store i32 %{{.*}}, i32* [[VAR]], align 1
index 4d156a49192fd403fb0b894aafb74292c4865eaf..882e4cb2d47e29e99d25056cd82bcdcf4f980c20 100644 (file)
@@ -8,8 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[allow(exceeding_bitshifts)]
-#[deny(const_err)]
+#![feature(rustc_attrs)]
+#![allow(exceeding_bitshifts)]
+#![deny(const_err)]
 
 fn black_box<T>(_: T) {
     unimplemented!()
@@ -18,6 +19,7 @@ fn black_box<T>(_: T) {
 const BLA: u8 = 200u8 + 200u8;
 //~^ ERROR attempted to add with overflow
 
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let a = -std::i8::MIN;
     //~^ WARN attempted to negate with overflow
index 3dfcb5bb29a24a68701b48d195f62aca3361240c..96013551ef4927ea17028eaa21e2ae96b31dafde 100644 (file)
@@ -8,6 +8,7 @@
 // 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 b83f0f73436cffe488e9f358ed532eec95f091e0..906056896be1e6eb3810283737655a019d6e4ee9 100644 (file)
     fn return_address() -> *const u8;
 }
 
-unsafe fn f() {
-    let _ = return_address();
-    //~^ ERROR invalid use of `return_address` intrinsic: function does not use out pointer
-}
+unsafe fn f() { let _ = return_address(); }
+//~^ ERROR invalid use of `return_address` intrinsic: function does not use out pointer
 
-unsafe fn g() -> isize {
-    let _ = return_address();
-    //~^ ERROR invalid use of `return_address` intrinsic: function does not use out pointer
-    0
-}
+unsafe fn g() -> isize { let _ = return_address(); 0 }
+//~^ ERROR invalid use of `return_address` intrinsic: function does not use out pointer
 
 fn main() {}
index 35c368f4cbedb5bb399156b590bbc7ad1f43dfdd..33954d23b19cbb0bf59bfa200be86d019a4a13b2 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
 #![allow(non_camel_case_types)]
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -34,6 +34,7 @@
     fn simd_xor<T>(x: T, y: T) -> T;
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
     let y = u32x4(0, 0, 0, 0);
index 4999b790b130a4e79cb9b9e4ea63b001f0ef93d8..cb3bed7209e2d6596eb219221254d46c695e88fb 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -35,6 +35,7 @@ struct f32x8(f32, f32, f32, f32,
     fn simd_cast<T, U>(x: T) -> U;
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
index 617b03a87117b75b3ff97d26c88c1f1b9b6ca2e0..0e7b2bd490470832fe7e61a6a786d7cf172ed20a 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -29,6 +29,7 @@ struct i16x8(i16, i16, i16, i16,
     fn simd_ge<T, U>(x: T, y: T) -> U;
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
index b0198c411d5679ec1e06727969e619c9fe0fad78..1f4cc72ffe717c2031de22da23096302aec09426 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -56,6 +56,7 @@ struct f32x8(f32, f32, f32, f32,
     fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
index de69b7b9fa6705ed03afd7c07abd96ef49415334..d3817b25d6100f6d364ec3515c20102ad0e7b665 100644 (file)
@@ -8,7 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 76d4de7ecb03ce907b987c4e16e705a4dc36373e..7a151c8c572f6dfe7db13bf5576f34e1c9a1acb5 100644 (file)
@@ -8,7 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 6c6a41fa6f2e3e6deaa21b8e62bcb2faa94b8959..c989cc594536ba11c02a1a65a218eef1dc01929c 100644 (file)
@@ -8,10 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 + 200u8 + 200u8;
 }
index 62935bacce8711f90b198d14fc5b7b387f1f53bc..a27210112982a6a76f932f21264f2d757ce8efe8 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1_i32 << 32;
 }
index f6e6cb105c51bd797fa12c0ae5cef393e8fe726d..fe0bcc5b98545f62ec02fae195cd229d648a4437 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1 << -1;
 }
index a70f31954c6edaf65d7331f6eff2199679f1d4d5..aac220d32d9ce4dfa51e12670fb866914d31d5b7 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = 1_u64 << 64;
 }
index 571feaeb94345f70b2de1103fa3db812f922a65b..7e8b266da49bee83dcbd81e26ba980107861a028 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
@@ -16,6 +18,8 @@
 
 #![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 a413a6f0abfa29d489fdac600e5f05a6cace1c2d..8cba700bbf9a3e0b59faa56765dadaf25407a4b4 100644 (file)
@@ -8,9 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 7891d1ce9bed4931d2bd8fb7cd6e2256b5a61115..2d9d746bef324517277816ca0a88064601a8ea48 100644 (file)
@@ -8,9 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 b58eaf7f836c2c2e1d38ad48d16159ef9c7f8059..63c808dc80a4ecebe1b0caa986d2f519d70d0b57 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i32 >> 32;
 }
index 40b468a6ad41974d4b50b5c943b48e7d21eeefa2..8b89e57c85bb5e33e254d83c4ae244e271dc4347 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i32 >> -1;
 }
index afe6a908cb5f13587dee7d6d6dd564e1081009fd..8874587064c35ec26f45bf7cc1e4ebdc09f565ba 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _x = -1_i64 >> 64;
 }
index 585186575f6eda614bd4631861624bd1205e5387..d74fd8a6b8e417abcd3d87c568668898dbea34c0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
@@ -16,6 +18,8 @@
 
 #![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 34a7ff833bbbdebb25f7e87d212d3c595da79858..249b952a5dca2643fec1d751066561c8327a3e64 100644 (file)
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![warn(exceeding_bitshifts)]
 
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let _n = 1i64 >> [64][0];
 }
index b6f4348b184de6829fa470a71fcb64ea7b63118f..1227f35444a60399a1f60125f405c1e3079fbf6c 100644 (file)
@@ -8,12 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'shift operation overflowed'
 // compile-flags: -C debug-assertions
 
 #![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 ece4d37c36eb31171ca1fa40009cb51f6893e0e5..ce243a50e0b66f2065b84c038af2279041d09404 100644 (file)
@@ -8,9 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // 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 a0ccc75afd05b5c6ea9f0029dc69049abd7d444c..fb54161c2c127db8dafd85cd069a9905bc173a89 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_attrs)]
 #![deny(warnings)]
 
 use std::env;
@@ -36,6 +37,7 @@ 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 247e82c2f09245ec06c8d6639b4a2889a505d94c..0de949471c68407cf66129e7aaa16d494d473d6d 100644 (file)
@@ -8,10 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // no-prefer-dynamic
 
 #![allow(dead_code)]
-#![feature(const_fn)]
+#![feature(const_fn, rustc_attrs)]
 
 // check dtor calling order when casting enums.
 
@@ -36,6 +38,7 @@ fn drop(&mut self) {
     }
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR miscompiles this.
 fn main() {
     assert_eq!(FLAG.load(Ordering::SeqCst), 0);
     {
index 48df600214ad0813863e490db07492724ab79867..b80c938fed5d42bb0c6fe3651c9195dee985f4e4 100644 (file)
@@ -11,6 +11,7 @@
 // ignore-test: not a test, used by backtrace-debuginfo.rs to test file!()
 
 #[inline(never)]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
     f((file!(), line!()))
 }
@@ -20,6 +21,7 @@ pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
 // this case.
 #[cfg_attr(not(target_env = "msvc"), inline(always))]
 #[cfg_attr(target_env = "msvc", inline(never))]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 pub fn callback_inlined<F>(f: F) where F: FnOnce((&'static str, u32)) {
     f((file!(), line!()))
 }
index 8b2b26948824f08d89b9252cc024a2714d5e773b..fd1c01723395d3182d6d3a48f9d0c586fc240a98 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_attrs)]
+
 // We disable tail merging here because it can't preserve debuginfo and thus
 // potentially breaks the backtraces. Also, subtle changes can decide whether
 // tail merging suceeds, so the test might work today but fail tomorrow due to a
@@ -72,6 +74,7 @@ fn dump_filelines(filelines: &[Pos]) {
 }
 
 #[inline(never)]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn inner(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
     check!(counter; main_pos, outer_pos);
     check!(counter; main_pos, outer_pos);
@@ -88,6 +91,7 @@ fn inner(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
 // this case.
 #[cfg_attr(not(target_env = "msvc"), inline(always))]
 #[cfg_attr(target_env = "msvc", inline(never))]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn inner_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
     check!(counter; main_pos, outer_pos);
     check!(counter; main_pos, outer_pos);
@@ -113,6 +117,7 @@ fn inner_further_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos, inner
 }
 
 #[inline(never)]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn outer(mut counter: i32, main_pos: Pos) {
     inner(&mut counter, main_pos, pos!());
     inner_inlined(&mut counter, main_pos, pos!());
@@ -157,6 +162,7 @@ fn run_test(me: &str) {
 }
 
 #[inline(never)]
+#[rustc_no_mir] // FIXME #31005 MIR missing debuginfo currently.
 fn main() {
     let args: Vec<String> = env::args().collect();
     if args.len() >= 2 {
index 4c5152ff90ffdfccfd131fce2832045db974741e..1736ab5bb82c81510e98cc4d80e3564a3e5639b8 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_attrs)]
+
+// ignore-pretty : (#23623) problems when  ending with // comments
 
 use std::{str, string};
 
@@ -15,6 +18,7 @@
 const B: &'static [u8; 2] = &A;
 const C: *const u8 = B as *const u8;
 
+#[rustc_no_mir] // FIXME #27840 MIR can't do rvalue promotion yet.
 pub fn main() {
     unsafe {
         let foo = &A as *const u8;
index 507d482febfd90b089154059cbce53a8848c461b..73c52a0843cfbd870c383fa30123b0343d1c239a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_attrs)]
+
 // ignore-pretty : (#23623) problems when  ending with // comments
 
 // This test is ensuring that parameters are indeed dropped after
@@ -64,6 +66,7 @@ fn test<'a>(log: d::Log<'a>) {
     d::println(&format!("result {}", result));
 }
 
+#[rustc_no_mir] // FIXME #29855 MIR doesn't handle all drops correctly.
 fn foo<'a>(da0: D<'a>, de1: D<'a>) -> D<'a> {
     d::println("entered foo");
     let de2 = de1.incr();      // creates D(de_2, 2)
index 8ec9f8aff8ec72da5143d30a96941768db3ed82c..7589bce31f480ca7faeb98051748ee4878a82777 100644 (file)
@@ -9,31 +9,44 @@
 // except according to those terms.
 
 // ignore-emscripten no threads support
+// ignore-pretty : (#23623) problems when  ending with // comments
 
-#![feature(zero_one)]
+#![feature(rustc_attrs, stmt_expr_attributes, zero_one)]
 
 use std::num::Zero;
 use std::thread;
 
+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() {
-    assert!(thread::spawn(move|| { isize::min_value() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i8::min_value() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i16::min_value() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i32::min_value() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i64::min_value() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { 1isize / isize::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i8 / i8::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i16 / i16::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i32 / i32::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i64 / i64::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { isize::min_value() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i8::min_value() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i16::min_value() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i32::min_value() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { i64::min_value() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { 1isize % isize::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i8 % i8::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i16 % i16::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i32 % i32::zero(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i64 % i64::zero(); }).join().is_err());
+    check![
+        isize::min_value() / -1,
+        i8::min_value() / -1,
+        i16::min_value() / -1,
+        i32::min_value() / -1,
+        i64::min_value() / -1,
+        1isize / isize::zero(),
+        1i8 / i8::zero(),
+        1i16 / i16::zero(),
+        1i32 / i32::zero(),
+        1i64 / i64::zero(),
+        isize::min_value() % -1,
+        i8::min_value() % -1,
+        i16::min_value() % -1,
+        i32::min_value() % -1,
+        i64::min_value() % -1,
+        1isize % isize::zero(),
+        1i8 % i8::zero(),
+        1i16 % i16::zero(),
+        1i32 % i32::zero(),
+        1i64 % i64::zero()
+    ];
 }
index 9bbfbb6822463083cad6d1252dbd58c06cbb3775..c0ba7a76dba480515e42dc683236966c922bc06b 100644 (file)
@@ -10,6 +10,8 @@
 
 #![feature(rustc_attrs)]
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // check raw fat pointer ops in mir
 // FIXME: please improve this when we get monomorphization support
 
@@ -119,6 +121,7 @@ fn foo(&self) -> usize {
 
 struct S<T:?Sized>(u32, T);
 
+#[rustc_no_mir] // FIXME #27840 MIR can't do rvalue promotion yet.
 fn main() {
     let array = [0,1,2,3,4];
     let array2 = [5,6,7,8,9];
index f0444c27170561550a80c85b48e8e4f3f17dd2c1..ffb9e6072dfe3cd488a5dd85e557c2448c00aa89 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, rustc_attrs, platform_intrinsics)]
+
+// ignore-pretty : (#23623) problems when  ending with // comments
 
 #[repr(simd)]
 #[derive(Copy, Clone, Debug, PartialEq)]
@@ -50,6 +52,7 @@ macro_rules! all_eq {
     }}
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't handle shuffle constants.
 fn main() {
     let x2 = i32x2(20, 21);
     let x3 = i32x3(30, 31, 32);
index fecbeed407c0359b749a333eff8b00af5354eeea..a663ae650c087574611c8156d098a3b5674abc22 100644 (file)
@@ -8,11 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_attrs, unsafe_no_drop_flag)]
 
-#![feature(unsafe_no_drop_flag)]
+// ignore-pretty : (#23623) problems when  ending with // comments
 
 static mut destructions : isize = 3;
 
+#[rustc_no_mir] // FIXME #29855 MIR doesn't handle all drops correctly.
 pub fn foo() {
     #[unsafe_no_drop_flag]
     struct Foo;