rewrite pretty-print-with-dep-file to rmake

This commit is contained in:
Oneirical 2024-06-26 10:39:45 -04:00
parent bae813a265
commit 2ffff791ce
3 changed files with 17 additions and 10 deletions

View File

@ -134,7 +134,6 @@ run-make/pgo-indirect-call-promotion/Makefile
run-make/pgo-use/Makefile
run-make/pointer-auth-link-with-c/Makefile
run-make/pretty-print-to-file/Makefile
run-make/pretty-print-with-dep-file/Makefile
run-make/print-calling-conventions/Makefile
run-make/print-target-list/Makefile
run-make/profile/Makefile

View File

@ -1,9 +0,0 @@
include ../tools.mk
all:
$(RUSTC) --emit=dep-info -Zunpretty=expanded with-dep.rs
$(CGREP) "with-dep.rs" < $(TMPDIR)/with-dep.d
-rm $(TMPDIR)/with-dep.d
$(RUSTC) --emit=dep-info -Zunpretty=normal with-dep.rs
! test -f $(TMPDIR)/with-dep.d

View File

@ -0,0 +1,17 @@
// Passing --emit=dep-info to the Rust compiler should create a .d file...
// but it failed to do so in Rust 1.69.0 when combined with -Z unpretty=expanded
// due to a bug. This test checks that -Z unpretty=expanded does not prevent the
// generation of the dep-info file, and that its -Z unpretty=normal counterpart
// does not get an unexpected dep-info file.
// See https://github.com/rust-lang/rust/issues/112898
use run_make_support::{fs_wrapper, invalid_utf8_contains, rustc};
use std::path::Path;
fn main() {
rustc().emit("dep-info").arg("-Zunpretty=expanded").input("with-dep.rs").run();
invalid_utf8_contains("with-dep.d", "with-dep.rs");
fs_wrapper::remove_file("with-dep.d");
rustc().emit("dep-info").arg("-Zunpretty=normal").input("with-dep.rs").run();
assert!(!Path::new("with-dep.d").exists());
}