Rollup merge of #126186 - GuillaumeGomez:migrate-run-make-multiple-emits, r=jieyouxu

Migrate `run-make/multiple-emits` to `rmake.rs`

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

r? `@jieyouxu`
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-06-11 14:16:45 +01:00 committed by GitHub
commit dea5237c0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 8 deletions

View File

@ -76,6 +76,11 @@ pub fn htmldocck() -> Command {
python
}
/// Returns the path for a local test file.
pub fn path<P: AsRef<Path>>(p: P) -> PathBuf {
cwd().join(p.as_ref())
}
/// Path to the root rust-lang/rust source checkout.
pub fn source_root() -> PathBuf {
env_var("SOURCE_ROOT").into()

View File

@ -144,7 +144,6 @@ run-make/mismatching-target-triples/Makefile
run-make/missing-crate-dependency/Makefile
run-make/mixing-libs/Makefile
run-make/msvc-opt-minsize/Makefile
run-make/multiple-emits/Makefile
run-make/native-link-modifier-bundle/Makefile
run-make/native-link-modifier-verbatim-linker/Makefile
run-make/native-link-modifier-verbatim-rustc/Makefile

View File

@ -1,7 +0,0 @@
include ../tools.mk
all:
$(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out 2>&1
rm $(TMPDIR)/out.ll $(TMPDIR)/out.s
$(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out2.ext 2>&1
rm $(TMPDIR)/out2.ll $(TMPDIR)/out2.s

View File

@ -0,0 +1,13 @@
use run_make_support::{cwd, path, rustc};
fn main() {
rustc().input("foo.rs").emit("asm,llvm-ir").output("out").run();
assert!(path("out.ll").is_file());
assert!(path("out.s").is_file());
rustc().input("foo.rs").emit("asm,llvm-ir").output("out2.ext").run();
assert!(path("out2.ll").is_file());
assert!(path("out2.s").is_file());
}