Rollup merge of #125653 - GuillaumeGomez:migrate-const-prop-lint, r=jieyouxu

Migrate `run-make/const-prop-lint` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ``@jieyouxu``
This commit is contained in:
León Orell Valerian Liehr 2024-05-30 01:12:34 +02:00 committed by GitHub
commit 3b6a3eb3cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 10 deletions

View file

@ -21,7 +21,6 @@ run-make/compiler-lookup-paths-2/Makefile
run-make/compiler-lookup-paths/Makefile
run-make/compiler-rt-works-on-mingw/Makefile
run-make/compressed-debuginfo/Makefile
run-make/const-prop-lint/Makefile
run-make/const_fn_mir/Makefile
run-make/crate-data-smoke/Makefile
run-make/crate-hash-rustc-version/Makefile

View file

@ -1,9 +0,0 @@
include ../tools.mk
# Test that emitting an error because of arithmetic
# overflow lint does not leave .o files around
# because of interrupted codegen.
all:
$(RUSTC) input.rs; test $$? -eq 1
ls *.o; test $$? -ne 0

View file

@ -0,0 +1,18 @@
// Tests that const prop lints interrupting codegen don't leave `.o` files around.
use std::fs;
use run_make_support::{rustc, tmp_dir};
fn main() {
rustc().input("input.rs").run_fail_assert_exit_code(1);
for entry in fs::read_dir(tmp_dir()).unwrap() {
let entry = entry.unwrap();
let path = entry.path();
if path.is_file() && path.extension().is_some_and(|ext| ext == "o") {
panic!("there should not be `.o` files!");
}
}
}