crashes: fix ice detection which did not trigger if code compiled without error by accident

This commit is contained in:
Matthias Krüger 2024-03-30 00:41:57 +01:00
parent 7d826ae43e
commit 6d9175f98e
12 changed files with 22 additions and 9 deletions

View file

@ -364,13 +364,16 @@ fn run_cfail_test(&self) {
fn run_crash_test(&self) {
let pm = self.pass_mode();
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 !proc_res.status.success() {
match proc_res.status.code() {
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")),
_ => (),
}
if proc_res.status.success() || matches!(proc_res.status.code(), 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 @@ fn compose_and_run(
}
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 {
status,

View file

@ -1,4 +1,5 @@
//@ known-bug: #101557
//@ compile-flags: -Copt-level=0
#![feature(generic_const_exprs)]
use std::marker::PhantomData;

View file

@ -1,4 +1,6 @@
//@ known-bug: #111699
//@ edition:2021
//@ compile-flags: -Copt-level=0
#![feature(core_intrinsics)]
use std::intrinsics::offset;

View file

@ -1,4 +1,6 @@
//@ known-bug: #115435
//@ edition:2021
//@ compile-flags: -Copt-level=0
trait MyTrait {
type Target: ?Sized;
}

View file

@ -1,4 +1,5 @@
//@ known-bug: #118320
//@ edition:2021
#![feature(const_trait_impl, effects, const_closures)]
#[const_trait]

View file

@ -1,4 +1,5 @@
//@ known-bug: #119692
//@ compile-flags: -Copt-level=0
#![allow(incomplete_features)]
#![feature(adt_const_params)]
#![feature(generic_const_exprs)]

View file

@ -1,4 +1,5 @@
//@ known-bug: #120241
//@ edition:2021
#![feature(object_safe_for_dispatch)]
#![feature(unsized_fn_params)]

View file

@ -1,4 +1,5 @@
//@ known-bug: #120241
//@ edition:2021
#![feature(object_safe_for_dispatch)]
trait B {

View file

@ -1,4 +1,5 @@
//@ known-bug: #120482
//@ edition:2021
#![feature(object_safe_for_dispatch)]
trait B {

View file

@ -1,4 +1,6 @@
//@ known-bug: #121444
//@ compile-flags: -Copt-level=0
//@ edition:2021
#[repr(align(536870912))]
pub struct A(i64);

View file

@ -1,4 +1,5 @@
//@ known-bug: #123157
//@ edition:2021
#![feature(type_alias_impl_trait)]
#[derive(Copy, Clone)]

View file

@ -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
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
issue number should be noted in the file name (12345.rs should suffice)