rewrite and rename issue-37839 to rmake
This commit is contained in:
parent
11dd90f761
commit
8daf82fece
8 changed files with 37 additions and 10 deletions
|
@ -35,7 +35,7 @@ pub use llvm::{
|
||||||
LlvmProfdata, LlvmReadobj,
|
LlvmProfdata, LlvmReadobj,
|
||||||
};
|
};
|
||||||
pub use run::{cmd, run, run_fail, run_with_args};
|
pub use run::{cmd, run, run_fail, run_with_args};
|
||||||
pub use rustc::{aux_build, rustc, Rustc};
|
pub use rustc::{aux_build, bare_rustc, rustc, Rustc};
|
||||||
pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
|
pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
|
|
|
@ -10,6 +10,12 @@ pub fn rustc() -> Rustc {
|
||||||
Rustc::new()
|
Rustc::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Construct a plain `rustc` invocation with no flags set.
|
||||||
|
#[track_caller]
|
||||||
|
pub fn bare_rustc() -> Rustc {
|
||||||
|
Rustc::bare()
|
||||||
|
}
|
||||||
|
|
||||||
/// Construct a new `rustc` aux-build invocation.
|
/// Construct a new `rustc` aux-build invocation.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn aux_build() -> Rustc {
|
pub fn aux_build() -> Rustc {
|
||||||
|
@ -30,7 +36,6 @@ fn setup_common() -> Command {
|
||||||
let rustc = env_var("RUSTC");
|
let rustc = env_var("RUSTC");
|
||||||
let mut cmd = Command::new(rustc);
|
let mut cmd = Command::new(rustc);
|
||||||
set_host_rpath(&mut cmd);
|
set_host_rpath(&mut cmd);
|
||||||
cmd.arg("-L").arg(cwd());
|
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +45,14 @@ impl Rustc {
|
||||||
/// Construct a new `rustc` invocation.
|
/// Construct a new `rustc` invocation.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
let mut cmd = setup_common();
|
||||||
|
cmd.arg("-L").arg(cwd());
|
||||||
|
Self { cmd }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Construct a bare `rustc` invocation with no flags set.
|
||||||
|
#[track_caller]
|
||||||
|
pub fn bare() -> Self {
|
||||||
let cmd = setup_common();
|
let cmd = setup_common();
|
||||||
Self { cmd }
|
Self { cmd }
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ run-make/issue-28595/Makefile
|
||||||
run-make/issue-33329/Makefile
|
run-make/issue-33329/Makefile
|
||||||
run-make/issue-35164/Makefile
|
run-make/issue-35164/Makefile
|
||||||
run-make/issue-36710/Makefile
|
run-make/issue-36710/Makefile
|
||||||
run-make/issue-37839/Makefile
|
|
||||||
run-make/issue-47551/Makefile
|
run-make/issue-47551/Makefile
|
||||||
run-make/issue-69368/Makefile
|
run-make/issue-69368/Makefile
|
||||||
run-make/issue-83045/Makefile
|
run-make/issue-83045/Makefile
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# ignore-cross-compile
|
|
||||||
include ../tools.mk
|
|
||||||
|
|
||||||
all:
|
|
||||||
$(RUSTC) a.rs && $(RUSTC) b.rs
|
|
||||||
$(BARE_RUSTC) c.rs -L dependency=$(TMPDIR) --extern b=$(TMPDIR)/libb.rlib \
|
|
||||||
--out-dir=$(TMPDIR)
|
|
22
tests/run-make/proc-macro-three-crates/rmake.rs
Normal file
22
tests/run-make/proc-macro-three-crates/rmake.rs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// A compiler bug caused the following issue:
|
||||||
|
// If a crate A depends on crate B, and crate B
|
||||||
|
// depends on crate C, and crate C contains a procedural
|
||||||
|
// macro, compiling crate A would fail.
|
||||||
|
// This was fixed in #37846, and this test checks
|
||||||
|
// that this bug does not make a resurgence.
|
||||||
|
|
||||||
|
//FIXME(Oneirical): ignore-cross-compile
|
||||||
|
|
||||||
|
use run_make_support::{bare_rustc, cwd, rust_lib_name, rustc};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
rustc().input("a.rs").run();
|
||||||
|
rustc().input("b.rs").run();
|
||||||
|
let curr_dir = cwd().display().to_string();
|
||||||
|
bare_rustc()
|
||||||
|
.input("c.rs")
|
||||||
|
.arg(format!("-Ldependency={curr_dir}"))
|
||||||
|
.extern_("b", cwd().join(rust_lib_name("b")))
|
||||||
|
.out_dir(cwd())
|
||||||
|
.run();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue