mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
Add #[rustc_no_mir] to make tests pass with -Z orbit.
This commit is contained in:
parent
080bd97781
commit
473f804491
@ -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]) {
|
||||
|
@ -72,6 +72,7 @@
|
||||
#![feature(reflect)]
|
||||
#![feature(unwind_attributes)]
|
||||
#![feature(repr_simd, platform_intrinsics)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(staged_api)]
|
||||
#![feature(unboxed_closures)]
|
||||
|
||||
|
@ -1008,6 +1008,7 @@ macro_rules! int_impl {
|
||||
/// ```
|
||||
#[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 @@ macro_rules! int_impl {
|
||||
/// ```
|
||||
#[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 @@ macro_rules! uint_impl {
|
||||
/// ```
|
||||
#[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();
|
||||
|
@ -251,6 +251,7 @@
|
||||
#![feature(raw)]
|
||||
#![feature(repr_simd)]
|
||||
#![feature(reflect_marker)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(shared)]
|
||||
#![feature(slice_bytes)]
|
||||
#![feature(slice_concat_ext)]
|
||||
|
@ -1371,6 +1371,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[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));
|
||||
|
@ -1264,6 +1264,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[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));
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 static STATIC: E<i16, i32> = E::A(0);
|
||||
|
||||
// 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 low_align_const() -> E<i16, [i16; 3]> {
|
||||
|
||||
// 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]]
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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 fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
|
||||
// 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
|
||||
|
@ -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
|
||||
|
@ -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 @@ const VALS_U64: (u64, u64, u64, u64) =
|
||||
//~^ ERROR attempted to multiply with overflow
|
||||
);
|
||||
|
||||
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
|
||||
fn main() {
|
||||
foo(VALS_I8);
|
||||
foo(VALS_I16);
|
||||
|
@ -15,15 +15,10 @@ extern "rust-intrinsic" {
|
||||
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() {}
|
||||
|
@ -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 @@ extern "platform-intrinsic" {
|
||||
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);
|
||||
|
@ -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 @@ extern "platform-intrinsic" {
|
||||
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);
|
||||
|
||||
|
@ -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 @@ extern "platform-intrinsic" {
|
||||
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);
|
||||
|
||||
|
@ -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 @@ extern "platform-intrinsic" {
|
||||
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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
}
|
||||
|
@ -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];
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 @@ impl Drop for E {
|
||||
}
|
||||
}
|
||||
|
||||
#[rustc_no_mir] // FIXME #27840 MIR miscompiles this.
|
||||
fn main() {
|
||||
assert_eq!(FLAG.load(Ordering::SeqCst), 0);
|
||||
{
|
||||
|
@ -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!()))
|
||||
}
|
||||
|
@ -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_inlined(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
|
||||
}
|
||||
|
||||
#[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 {
|
||||
|
@ -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 A: [u8; 2] = ['h' as u8, 'i' as u8];
|
||||
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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
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());
|
||||
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,
|
||||
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()
|
||||
];
|
||||
}
|
||||
|
@ -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 @@ impl<T> Foo for T {
|
||||
|
||||
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];
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user