diff options
| author | Oneirical <manchot@videotron.ca> | 2024-05-17 13:29:43 -0400 |
|---|---|---|
| committer | Oneirical <manchot@videotron.ca> | 2024-05-17 13:29:43 -0400 |
| commit | f0b8da4430971ce1a34848852849b8b4e3f20778 (patch) | |
| tree | 24026e3e7b93f53f63c938f83a8788086b1b183d /tests | |
| parent | ddba1dc97e83f22165b36dd6158477c49bbbd019 (diff) | |
| download | rust-f0b8da4430971ce1a34848852849b8b4e3f20778.tar.gz rust-f0b8da4430971ce1a34848852849b8b4e3f20778.zip | |
rewrite no-intermediate-extras
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run-make/no-intermediate-extras/Makefile | 8 | ||||
| -rw-r--r-- | tests/run-make/no-intermediate-extras/rmake.rs | 21 |
2 files changed, 21 insertions, 8 deletions
diff --git a/tests/run-make/no-intermediate-extras/Makefile b/tests/run-make/no-intermediate-extras/Makefile deleted file mode 100644 index 83b5cedcf2a..00000000000 --- a/tests/run-make/no-intermediate-extras/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# ignore-cross-compile -# Regression test for issue #10973 - -include ../tools.mk - -all: - $(RUSTC) --crate-type=rlib --test foo.rs - rm $(TMPDIR)/foo.bc && exit 1 || exit 0 diff --git a/tests/run-make/no-intermediate-extras/rmake.rs b/tests/run-make/no-intermediate-extras/rmake.rs new file mode 100644 index 00000000000..4ca95a1538d --- /dev/null +++ b/tests/run-make/no-intermediate-extras/rmake.rs @@ -0,0 +1,21 @@ +// When using the --test flag with an rlib, this used to generate +// an unwanted .bc file, which should not exist. This test checks +// that the bug causing the generation of this file has not returned. +// See https://github.com/rust-lang/rust/issues/10973 + +//@ ignore-cross-compile + +use run_make_support::{rustc, tmp_dir}; + +fn main() { + rustc().crate_type("rlib").arg("--test").input("foo.rs").run(); + match fs::remove_file(tmp_dir().join("foo.bc")) { + Ok(_) => { + println!("An unwanted .bc file was created by run-make/no-intermediate-extras."); + std::process::exit(0); + }, + Err(e) => { + std::process::exit(1); + } + } +} |
