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

This commit is contained in:
Guillaume Gomez 2024-05-28 13:39:21 +02:00
parent c0d600385b
commit 5b0e6cb672
3 changed files with 18 additions and 10 deletions

View File

@ -22,7 +22,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!");
}
}
}