From: Eduard Burtescu Date: Thu, 10 Mar 2016 19:20:09 +0000 (+0200) Subject: Add #[rustc_no_mir] to make tests pass with -Z orbit. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=473f804491772fe9a31f4096c3ec8da121fc8294;p=rust.git Add #[rustc_no_mir] to make tests pass with -Z orbit. --- diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 1d1f5489c48..943d7d4d9bd 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -863,12 +863,28 @@ fn cleanup_debug_info_options(options: &Option) -> Option { "-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::>() - .join(" "); - Some(new_options) + .collect::>(); + + 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]) { diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index f76b8655ad1..13d3f42ba18 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -72,6 +72,7 @@ #![feature(reflect)] #![feature(unwind_attributes)] #![feature(repr_simd, platform_intrinsics)] +#![feature(rustc_attrs)] #![feature(staged_api)] #![feature(unboxed_closures)] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 5a2a043d6f1..e6f83498ab1 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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(); diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cd0e3a030bd..85e48f85d3d 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -251,6 +251,7 @@ #![feature(raw)] #![feature(repr_simd)] #![feature(reflect_marker)] +#![feature(rustc_attrs)] #![feature(shared)] #![feature(slice_bytes)] #![feature(slice_concat_ext)] diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 37053025924..e78d46b22e9 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -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)); diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 446e22a20ad..cea5a9edd68 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -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)); diff --git a/src/test/codegen/adjustments.rs b/src/test/codegen/adjustments.rs index a61fa84398e..20d04939434 100644 --- a/src/test/codegen/adjustments.rs +++ b/src/test/codegen/adjustments.rs @@ -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 diff --git a/src/test/codegen/coercions.rs b/src/test/codegen/coercions.rs index c8c9f5b407c..74c7192259a 100644 --- a/src/test/codegen/coercions.rs +++ b/src/test/codegen/coercions.rs @@ -11,12 +11,14 @@ // 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 } diff --git a/src/test/codegen/consts.rs b/src/test/codegen/consts.rs index 6b4e626df92..ea4c932d435 100644 --- a/src/test/codegen/consts.rs +++ b/src/test/codegen/consts.rs @@ -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 { // CHECK-LABEL: @static_enum_const #[no_mangle] +#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn static_enum_const() -> E { STATIC } // CHECK-LABEL: @inline_enum_const #[no_mangle] +#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn inline_enum_const() -> E { 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 { // 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 { // CHECK-LABEL: @high_align_const #[no_mangle] +#[rustc_no_mir] // FIXME #27840 MIR has different codegen. pub fn high_align_const() -> E { // Check that low_align_const and high_align_const use the same constant // CHECK: call void @llvm.memcpy.{{.*}}(i8* %{{[0-9]}}, i8* {{.*}} [[LOW_HIGH]] diff --git a/src/test/codegen/drop.rs b/src/test/codegen/drop.rs index 2ac8de6d802..83dd6a3b002 100644 --- a/src/test/codegen/drop.rs +++ b/src/test/codegen/drop.rs @@ -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 diff --git a/src/test/codegen/refs.rs b/src/test/codegen/refs.rs index 08eec0045f7..36c83412e4f 100644 --- a/src/test/codegen/refs.rs +++ b/src/test/codegen/refs.rs @@ -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" diff --git a/src/test/codegen/stores.rs b/src/test/codegen/stores.rs index 46e4c5f341b..f849a6c9b18 100644 --- a/src/test/codegen/stores.rs +++ b/src/test/codegen/stores.rs @@ -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 diff --git a/src/test/compile-fail/const-err.rs b/src/test/compile-fail/const-err.rs index 4d156a49192..882e4cb2d47 100644 --- a/src/test/compile-fail/const-err.rs +++ b/src/test/compile-fail/const-err.rs @@ -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) { unimplemented!() @@ -18,6 +19,7 @@ fn black_box(_: 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 diff --git a/src/test/compile-fail/const-eval-overflow.rs b/src/test/compile-fail/const-eval-overflow.rs index 3dfcb5bb29a..96013551ef4 100644 --- a/src/test/compile-fail/const-eval-overflow.rs +++ b/src/test/compile-fail/const-eval-overflow.rs @@ -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 @@ -103,6 +104,7 @@ //~^ ERROR attempted to multiply with overflow ); +#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD. fn main() { foo(VALS_I8); foo(VALS_I16); diff --git a/src/test/compile-fail/intrinsic-return-address.rs b/src/test/compile-fail/intrinsic-return-address.rs index b83f0f73436..906056896be 100644 --- a/src/test/compile-fail/intrinsic-return-address.rs +++ b/src/test/compile-fail/intrinsic-return-address.rs @@ -15,15 +15,10 @@ 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() {} diff --git a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs b/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs index 35c368f4cbe..33954d23b19 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs +++ b/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs @@ -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(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); diff --git a/src/test/compile-fail/simd-intrinsic-generic-cast.rs b/src/test/compile-fail/simd-intrinsic-generic-cast.rs index 4999b790b13..cb3bed7209e 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-cast.rs +++ b/src/test/compile-fail/simd-intrinsic-generic-cast.rs @@ -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(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); diff --git a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs b/src/test/compile-fail/simd-intrinsic-generic-comparison.rs index 617b03a8711..0e7b2bd4904 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs +++ b/src/test/compile-fail/simd-intrinsic-generic-comparison.rs @@ -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(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); diff --git a/src/test/compile-fail/simd-intrinsic-generic-elements.rs b/src/test/compile-fail/simd-intrinsic-generic-elements.rs index b0198c411d5..1f4cc72ffe7 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-elements.rs +++ b/src/test/compile-fail/simd-intrinsic-generic-elements.rs @@ -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(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); diff --git a/src/test/run-fail/divide-by-zero.rs b/src/test/run-fail/divide-by-zero.rs index de69b7b9fa6..d3817b25d61 100644 --- a/src/test/run-fail/divide-by-zero.rs +++ b/src/test/run-fail/divide-by-zero.rs @@ -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; diff --git a/src/test/run-fail/mod-zero.rs b/src/test/run-fail/mod-zero.rs index 76d4de7ecb0..7a151c8c572 100644 --- a/src/test/run-fail/mod-zero.rs +++ b/src/test/run-fail/mod-zero.rs @@ -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; diff --git a/src/test/run-fail/overflowing-add.rs b/src/test/run-fail/overflowing-add.rs index 6c6a41fa6f2..c989cc59453 100644 --- a/src/test/run-fail/overflowing-add.rs +++ b/src/test/run-fail/overflowing-add.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-lsh-1.rs b/src/test/run-fail/overflowing-lsh-1.rs index 62935bacce8..a2721011298 100644 --- a/src/test/run-fail/overflowing-lsh-1.rs +++ b/src/test/run-fail/overflowing-lsh-1.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-lsh-2.rs b/src/test/run-fail/overflowing-lsh-2.rs index f6e6cb105c5..fe0bcc5b985 100644 --- a/src/test/run-fail/overflowing-lsh-2.rs +++ b/src/test/run-fail/overflowing-lsh-2.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-lsh-3.rs b/src/test/run-fail/overflowing-lsh-3.rs index a70f31954c6..aac220d32d9 100644 --- a/src/test/run-fail/overflowing-lsh-3.rs +++ b/src/test/run-fail/overflowing-lsh-3.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-lsh-4.rs b/src/test/run-fail/overflowing-lsh-4.rs index 571feaeb943..7e8b266da49 100644 --- a/src/test/run-fail/overflowing-lsh-4.rs +++ b/src/test/run-fail/overflowing-lsh-4.rs @@ -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 '
' 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; diff --git a/src/test/run-fail/overflowing-mul.rs b/src/test/run-fail/overflowing-mul.rs index a413a6f0abf..8cba700bbf9 100644 --- a/src/test/run-fail/overflowing-mul.rs +++ b/src/test/run-fail/overflowing-mul.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-neg.rs b/src/test/run-fail/overflowing-neg.rs index 7891d1ce9be..2d9d746bef3 100644 --- a/src/test/run-fail/overflowing-neg.rs +++ b/src/test/run-fail/overflowing-neg.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-rsh-1.rs b/src/test/run-fail/overflowing-rsh-1.rs index b58eaf7f836..63c808dc80a 100644 --- a/src/test/run-fail/overflowing-rsh-1.rs +++ b/src/test/run-fail/overflowing-rsh-1.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-rsh-2.rs b/src/test/run-fail/overflowing-rsh-2.rs index 40b468a6ad4..8b89e57c85b 100644 --- a/src/test/run-fail/overflowing-rsh-2.rs +++ b/src/test/run-fail/overflowing-rsh-2.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-rsh-3.rs b/src/test/run-fail/overflowing-rsh-3.rs index afe6a908cb5..8874587064c 100644 --- a/src/test/run-fail/overflowing-rsh-3.rs +++ b/src/test/run-fail/overflowing-rsh-3.rs @@ -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 '
' 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; } diff --git a/src/test/run-fail/overflowing-rsh-4.rs b/src/test/run-fail/overflowing-rsh-4.rs index 585186575f6..d74fd8a6b8e 100644 --- a/src/test/run-fail/overflowing-rsh-4.rs +++ b/src/test/run-fail/overflowing-rsh-4.rs @@ -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 '
' 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; diff --git a/src/test/run-fail/overflowing-rsh-5.rs b/src/test/run-fail/overflowing-rsh-5.rs index 34a7ff833bb..249b952a5dc 100644 --- a/src/test/run-fail/overflowing-rsh-5.rs +++ b/src/test/run-fail/overflowing-rsh-5.rs @@ -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 '
' 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]; } diff --git a/src/test/run-fail/overflowing-rsh-6.rs b/src/test/run-fail/overflowing-rsh-6.rs index b6f4348b184..1227f35444a 100644 --- a/src/test/run-fail/overflowing-rsh-6.rs +++ b/src/test/run-fail/overflowing-rsh-6.rs @@ -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 '
' 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]; } diff --git a/src/test/run-fail/overflowing-sub.rs b/src/test/run-fail/overflowing-sub.rs index ece4d37c36e..ce243a50e0b 100644 --- a/src/test/run-fail/overflowing-sub.rs +++ b/src/test/run-fail/overflowing-sub.rs @@ -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 '
' 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); } diff --git a/src/test/run-make/debug-assertions/debug.rs b/src/test/run-make/debug-assertions/debug.rs index a0ccc75afd0..fb54161c2c1 100644 --- a/src/test/run-make/debug-assertions/debug.rs +++ b/src/test/run-make/debug-assertions/debug.rs @@ -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); diff --git a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs index 247e82c2f09..0de949471c6 100644 --- a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs +++ b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs @@ -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); { diff --git a/src/test/run-pass/backtrace-debuginfo-aux.rs b/src/test/run-pass/backtrace-debuginfo-aux.rs index 48df600214a..b80c938fed5 100644 --- a/src/test/run-pass/backtrace-debuginfo-aux.rs +++ b/src/test/run-pass/backtrace-debuginfo-aux.rs @@ -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) where F: FnOnce((&'static str, u32)) { f((file!(), line!())) } @@ -20,6 +21,7 @@ pub fn callback(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) where F: FnOnce((&'static str, u32)) { f((file!(), line!())) } diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs index 8b2b2694882..fd1c0172339 100644 --- a/src/test/run-pass/backtrace-debuginfo.rs +++ b/src/test/run-pass/backtrace-debuginfo.rs @@ -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 = env::args().collect(); if args.len() >= 2 { diff --git a/src/test/run-pass/const-str-ptr.rs b/src/test/run-pass/const-str-ptr.rs index 4c5152ff90f..1736ab5bb82 100644 --- a/src/test/run-pass/const-str-ptr.rs +++ b/src/test/run-pass/const-str-ptr.rs @@ -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; diff --git a/src/test/run-pass/issue-23338-ensure-param-drop-order.rs b/src/test/run-pass/issue-23338-ensure-param-drop-order.rs index 507d482febf..73c52a0843c 100644 --- a/src/test/run-pass/issue-23338-ensure-param-drop-order.rs +++ b/src/test/run-pass/issue-23338-ensure-param-drop-order.rs @@ -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) diff --git a/src/test/run-pass/issue-8460.rs b/src/test/run-pass/issue-8460.rs index 8ec9f8aff8e..7589bce31f4 100644 --- a/src/test/run-pass/issue-8460.rs +++ b/src/test/run-pass/issue-8460.rs @@ -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() + ]; } diff --git a/src/test/run-pass/mir_raw_fat_ptr.rs b/src/test/run-pass/mir_raw_fat_ptr.rs index 9bbfbb68224..c0ba7a76dba 100644 --- a/src/test/run-pass/mir_raw_fat_ptr.rs +++ b/src/test/run-pass/mir_raw_fat_ptr.rs @@ -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(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]; diff --git a/src/test/run-pass/simd-intrinsic-generic-elements.rs b/src/test/run-pass/simd-intrinsic-generic-elements.rs index f0444c27170..ffb9e6072df 100644 --- a/src/test/run-pass/simd-intrinsic-generic-elements.rs +++ b/src/test/run-pass/simd-intrinsic-generic-elements.rs @@ -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); diff --git a/src/test/run-pass/zero-size-type-destructors.rs b/src/test/run-pass/zero-size-type-destructors.rs index fecbeed407c..a663ae650c0 100644 --- a/src/test/run-pass/zero-size-type-destructors.rs +++ b/src/test/run-pass/zero-size-type-destructors.rs @@ -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;