forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#126611 - jieyouxu:rollup-061kmhl, r=jieyouxu
Rollup of 5 pull requests Successful merges: - rust-lang#126279 (Migrate `inaccessible-temp-dir`, `output-with-hyphens` and `issue-10971-temps-dir` `run-make` tests to `rmake`) - rust-lang#126437 (Migrate `issue-64153`, `invalid-staticlib` and `no-builtins-lto` `run-make` tests to `rmake`) - rust-lang#126490 (Migrate `extern-flag-fun`, `incremental-debugger-visualiser` and `incremental-session-fail` `run-make` tests to `rmake.rs`) - rust-lang#126500 (Migrate `error-found-staticlib-instead-crate`, `output-filename-conflicts-with-directory`, `output-filename-overwrites-input`, `native-link-modifier-verbatim-rustc` and `native-link-verbatim-linker` `run-make` tests to `rmake.rs` format) - rust-lang#126534 (Migrate `run-make/comment-section` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
35 changed files
with
560 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Both GCC and Clang write by default a `.comment` section with compiler information. | ||
// Rustc received a similar .comment section, so this tests checks that this section | ||
// properly appears. | ||
// See https://github.com/rust-lang/rust/commit/74b8d324eb77a8f337b35dc68ac91b0c2c06debc | ||
|
||
//@ only-linux | ||
|
||
use std::path::PathBuf; | ||
|
||
use run_make_support::llvm_readobj; | ||
use run_make_support::rustc; | ||
use run_make_support::{cwd, env_var, read_dir, run_in_tmpdir}; | ||
|
||
fn main() { | ||
let target = env_var("TARGET"); | ||
|
||
rustc() | ||
.arg("-") | ||
.stdin("fn main() {}") | ||
.emit("link,obj") | ||
.arg("-Csave-temps") | ||
.target(&target) | ||
.run(); | ||
|
||
// Check linked output has a `.comment` section with the expected content. | ||
llvm_readobj() | ||
.section(".comment") | ||
.input("rust_out") | ||
.run() | ||
.assert_stdout_contains("rustc version 1."); | ||
|
||
// Check all object files (including temporary outputs) have a `.comment` | ||
// section with the expected content. | ||
read_dir(cwd(), |f| { | ||
if !f.extension().is_some_and(|ext| ext == "o") { | ||
return; | ||
} | ||
|
||
llvm_readobj() | ||
.section(".comment") | ||
.input(&f) | ||
.run() | ||
.assert_stdout_contains("rustc version 1."); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
tests/run-make/error-found-staticlib-instead-crate/rmake.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// When rustc is looking for a crate but is given a staticlib instead, | ||
// the error message should be helpful and indicate precisely the cause | ||
// of the compilation failure. | ||
// See https://github.com/rust-lang/rust/pull/21978 | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").crate_type("staticlib").run(); | ||
rustc().input("bar.rs").run_fail().assert_stderr_contains("found staticlib"); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.