mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
rewrite incr-foreign-head-span to rmake
This commit is contained in:
parent
c424bc61bf
commit
e175b83fd5
@ -201,6 +201,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
|
|||||||
"only-wasm32-wasip1",
|
"only-wasm32-wasip1",
|
||||||
"only-watchos",
|
"only-watchos",
|
||||||
"only-windows",
|
"only-windows",
|
||||||
|
"only-windows-gnu",
|
||||||
"only-x86",
|
"only-x86",
|
||||||
"only-x86_64",
|
"only-x86_64",
|
||||||
"only-x86_64-fortanix-unknown-sgx",
|
"only-x86_64-fortanix-unknown-sgx",
|
||||||
|
@ -16,6 +16,7 @@ pub fn cc() -> Cc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Construct a new platform-specific CXX compiler invocation.
|
/// Construct a new platform-specific CXX compiler invocation.
|
||||||
|
/// CXX_DEFAULT_FLAGS is passed from compiletest.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn cxx() -> Cc {
|
pub fn cxx() -> Cc {
|
||||||
Cc::new_cxx()
|
Cc::new_cxx()
|
||||||
@ -51,6 +52,7 @@ impl Cc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Construct a new platform-specific CXX compiler invocation.
|
/// Construct a new platform-specific CXX compiler invocation.
|
||||||
|
/// CXX_DEFAULT_FLAGS is passed from compiletest.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn new_cxx() -> Self {
|
pub fn new_cxx() -> Self {
|
||||||
let compiler = env_var("CXX");
|
let compiler = env_var("CXX");
|
||||||
|
@ -19,7 +19,6 @@ run-make/foreign-double-unwind/Makefile
|
|||||||
run-make/foreign-exceptions/Makefile
|
run-make/foreign-exceptions/Makefile
|
||||||
run-make/foreign-rust-exceptions/Makefile
|
run-make/foreign-rust-exceptions/Makefile
|
||||||
run-make/incr-add-rust-src-component/Makefile
|
run-make/incr-add-rust-src-component/Makefile
|
||||||
run-make/incr-foreign-head-span/Makefile
|
|
||||||
run-make/issue-35164/Makefile
|
run-make/issue-35164/Makefile
|
||||||
run-make/issue-36710/Makefile
|
run-make/issue-36710/Makefile
|
||||||
run-make/issue-47551/Makefile
|
run-make/issue-47551/Makefile
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// `compiler-rt` ("runtime") is a suite of LLVM features compatible with rustc.
|
// `compiler-rt` ("runtime") is a suite of LLVM features compatible with rustc.
|
||||||
// After building it was enabled on Windows-gnu in #29874, this test checks
|
// After building it was enabled on Windows-gnu in #29874, this test is a basic smoke test to
|
||||||
// that compilation and execution with it are successful.
|
// check if building and linking to it can work at all.
|
||||||
// See https://github.com/rust-lang/rust/pull/29478
|
// See https://github.com/rust-lang/rust/pull/29478
|
||||||
|
|
||||||
//@ only-windows-gnu
|
//@ only-windows-gnu
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
include ../tools.mk
|
|
||||||
|
|
||||||
# ignore-none no-std is not supported
|
|
||||||
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'
|
|
||||||
|
|
||||||
# Ensure that modifying a crate on disk (without recompiling it)
|
|
||||||
# does not cause ICEs in downstream crates.
|
|
||||||
# Previously, we would call `SourceMap.guess_head_span` on a span
|
|
||||||
# from an external crate, which would cause us to read an upstream
|
|
||||||
# source file from disk during compilation of a downstream crate
|
|
||||||
# See #86480 for more details
|
|
||||||
|
|
||||||
INCR=$(TMPDIR)/incr
|
|
||||||
|
|
||||||
all:
|
|
||||||
cp first_crate.rs second_crate.rs $(TMPDIR)
|
|
||||||
$(RUSTC) $(TMPDIR)/first_crate.rs -C incremental=$(INCR) --target $(TARGET) --crate-type lib
|
|
||||||
$(RUSTC) $(TMPDIR)/second_crate.rs -C incremental=$(INCR) --target $(TARGET) --extern first_crate=$(TMPDIR)/libfirst_crate.rlib --crate-type lib
|
|
||||||
rm $(TMPDIR)/first_crate.rs
|
|
||||||
$(RUSTC) $(TMPDIR)/second_crate.rs -C incremental=$(INCR) --target $(TARGET) --cfg second_run --crate-type lib
|
|
||||||
|
|
25
tests/run-make/incr-foreign-head-span/rmake.rs
Normal file
25
tests/run-make/incr-foreign-head-span/rmake.rs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Ensure that modifying a crate on disk (without recompiling it)
|
||||||
|
// does not cause ICEs (internal compiler errors) in downstream crates.
|
||||||
|
// Previously, we would call `SourceMap.guess_head_span` on a span
|
||||||
|
// from an external crate, which would cause us to read an upstream
|
||||||
|
// source file from disk during compilation of a downstream crate.
|
||||||
|
// See https://github.com/rust-lang/rust/issues/86480
|
||||||
|
|
||||||
|
//@ ignore-none
|
||||||
|
// Reason: no-std is not supported
|
||||||
|
//@ ignore-nvptx64-nvidia-cuda
|
||||||
|
// Reason: can't find crate for 'std'
|
||||||
|
|
||||||
|
use run_make_support::{rfs, rust_lib_name, rustc};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
rustc().input("first_crate.rs").incremental("incr").crate_type("lib").run();
|
||||||
|
rustc()
|
||||||
|
.input("second_crate.rs")
|
||||||
|
.incremental("incr")
|
||||||
|
.extern_("first_crate", rust_lib_name("first_crate"))
|
||||||
|
.crate_type("lib")
|
||||||
|
.run();
|
||||||
|
rfs::remove_file("first_crate.rs");
|
||||||
|
rustc().input("second_crate.rs").incremental("incr").cfg("second_run").crate_type("lib").run();
|
||||||
|
}
|
@ -6,7 +6,9 @@
|
|||||||
// library will be stripped out, and the linkage will fail.
|
// library will be stripped out, and the linkage will fail.
|
||||||
// See https://github.com/rust-lang/rust/commit/e6072fa0c4c22d62acf3dcb78c8ee260a1368bd7
|
// See https://github.com/rust-lang/rust/commit/e6072fa0c4c22d62acf3dcb78c8ee260a1368bd7
|
||||||
|
|
||||||
// FIXME(Oneirical): test-various
|
//@ ignore-cross-compile
|
||||||
|
// Reason: linkage still fails as the object files produced are not in the correct
|
||||||
|
// format in the `build_native_static_lib` step
|
||||||
|
|
||||||
use run_make_support::{build_native_static_lib, rustc};
|
use run_make_support::{build_native_static_lib, rustc};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user