crashes: fix ice detection which did not trigger if code compiled without error by accident
This commit is contained in:
parent
7d826ae43e
commit
6d9175f98e
12 changed files with 22 additions and 9 deletions
|
@ -364,13 +364,16 @@ impl<'test> TestCx<'test> {
|
||||||
fn run_crash_test(&self) {
|
fn run_crash_test(&self) {
|
||||||
let pm = self.pass_mode();
|
let pm = self.pass_mode();
|
||||||
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
|
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
|
||||||
|
/*
|
||||||
|
eprintln!("{}", proc_res.status);
|
||||||
|
eprintln!("{}", proc_res.stdout);
|
||||||
|
eprintln!("{}", proc_res.stderr);
|
||||||
|
eprintln!("{}", proc_res.cmdline);
|
||||||
|
*/
|
||||||
|
|
||||||
// if a test does not crash, consider it an error
|
// if a test does not crash, consider it an error
|
||||||
if !proc_res.status.success() {
|
if proc_res.status.success() || matches!(proc_res.status.code(), Some(1 | 0)) {
|
||||||
match proc_res.status.code() {
|
self.fatal(&format!("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit"));
|
||||||
Some(1 | 0) => self.fatal(&format!("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit")),
|
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2322,9 +2325,6 @@ impl<'test> TestCx<'test> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let (Output { status, stdout, stderr }, truncated) = self.read2_abbreviated(child);
|
let (Output { status, stdout, stderr }, truncated) = self.read2_abbreviated(child);
|
||||||
eprintln!("{:?}", status);
|
|
||||||
eprintln!("{}", String::from_utf8_lossy(&stdout).into_owned());
|
|
||||||
eprintln!("{}", String::from_utf8_lossy(&stdout).into_owned());
|
|
||||||
|
|
||||||
let result = ProcRes {
|
let result = ProcRes {
|
||||||
status,
|
status,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #101557
|
//@ known-bug: #101557
|
||||||
|
//@ compile-flags: -Copt-level=0
|
||||||
#![feature(generic_const_exprs)]
|
#![feature(generic_const_exprs)]
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
//@ known-bug: #111699
|
//@ known-bug: #111699
|
||||||
|
//@ edition:2021
|
||||||
|
//@ compile-flags: -Copt-level=0
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
use std::intrinsics::offset;
|
use std::intrinsics::offset;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
//@ known-bug: #115435
|
//@ known-bug: #115435
|
||||||
|
//@ edition:2021
|
||||||
|
//@ compile-flags: -Copt-level=0
|
||||||
trait MyTrait {
|
trait MyTrait {
|
||||||
type Target: ?Sized;
|
type Target: ?Sized;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #118320
|
//@ known-bug: #118320
|
||||||
|
//@ edition:2021
|
||||||
#![feature(const_trait_impl, effects, const_closures)]
|
#![feature(const_trait_impl, effects, const_closures)]
|
||||||
|
|
||||||
#[const_trait]
|
#[const_trait]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #119692
|
//@ known-bug: #119692
|
||||||
|
//@ compile-flags: -Copt-level=0
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
#![feature(adt_const_params)]
|
#![feature(adt_const_params)]
|
||||||
#![feature(generic_const_exprs)]
|
#![feature(generic_const_exprs)]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #120241
|
//@ known-bug: #120241
|
||||||
|
//@ edition:2021
|
||||||
#![feature(object_safe_for_dispatch)]
|
#![feature(object_safe_for_dispatch)]
|
||||||
#![feature(unsized_fn_params)]
|
#![feature(unsized_fn_params)]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #120241
|
//@ known-bug: #120241
|
||||||
|
//@ edition:2021
|
||||||
#![feature(object_safe_for_dispatch)]
|
#![feature(object_safe_for_dispatch)]
|
||||||
|
|
||||||
trait B {
|
trait B {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #120482
|
//@ known-bug: #120482
|
||||||
|
//@ edition:2021
|
||||||
#![feature(object_safe_for_dispatch)]
|
#![feature(object_safe_for_dispatch)]
|
||||||
|
|
||||||
trait B {
|
trait B {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
//@ known-bug: #121444
|
//@ known-bug: #121444
|
||||||
|
//@ compile-flags: -Copt-level=0
|
||||||
|
//@ edition:2021
|
||||||
#[repr(align(536870912))]
|
#[repr(align(536870912))]
|
||||||
pub struct A(i64);
|
pub struct A(i64);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//@ known-bug: #123157
|
//@ known-bug: #123157
|
||||||
|
//@ edition:2021
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -4,7 +4,7 @@ the rustc testsuite is more convenient.
|
||||||
|
|
||||||
It is imperative that a test in the suite causes an internal compiler error/panic
|
It is imperative that a test in the suite causes an internal compiler error/panic
|
||||||
or makes rustc crash in some other way.
|
or makes rustc crash in some other way.
|
||||||
Accepted exit codes are: 101 (may be expanded later)
|
A test will "pass" if rustc exits with something other than 1 or 0.
|
||||||
|
|
||||||
When adding crashes from https://github.com/rust-lang/rust/issues, the
|
When adding crashes from https://github.com/rust-lang/rust/issues, the
|
||||||
issue number should be noted in the file name (12345.rs should suffice)
|
issue number should be noted in the file name (12345.rs should suffice)
|
||||||
|
|
Loading…
Add table
Reference in a new issue