forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#127121 - GuillaumeGomez:rollup-xjjjckn, r=Gui…
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#126805 (Migrate `pdb-alt-path`, `mismatching-target-triples` and `mingw-export-call-convention` `run-make` tests to rmake) - rust-lang#126995 (Migrate `pretty-print-with-dep-file`, `pretty-print-to-file` and `libtest-padding` `run-make` tests to rmake) - rust-lang#127041 (Migrate `run-make/override-aliased-flags` to `rmake.rs`) - rust-lang#127072 (docs: say "includes" instead of "does include") - rust-lang#127073 (Remove unnecessary SeqCst in `impl fmt::Pointer for AtomicPtr`) - rust-lang#127112 (Bootstrap: Don't get output if `lldb --version` errors) - rust-lang#127116 (Migrate `run-make/return-non-c-like-enum` to `rmake.rs`) Failed merges: - rust-lang#127050 (Make mtime of reproducible tarballs dependent on git commit) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
203 additions
and
124 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 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,46 @@ | ||
// Benchmarks, when ran as tests, would cause strange indentations | ||
// to appear in the output. This was because padding formatting was | ||
// applied before the conversion from bench to test, and not afterwards. | ||
// Now that this bug has been fixed in #118548, this test checks that it | ||
// does not make a resurgence by comparing the output of --bench with an | ||
// example stdout file. | ||
// See https://github.com/rust-lang/rust/issues/104092 | ||
|
||
//@ ignore-cross-compile | ||
// Reason: the compiled code is ran | ||
//@ needs-unwind | ||
// Reason: #[bench] requires -Z panic-abort-tests | ||
|
||
use run_make_support::{diff, run_with_args, rustc}; | ||
|
||
fn main() { | ||
rustc().arg("--test").input("tests.rs").run(); | ||
let out = run_with_args("tests", &["--test-threads=1"]).stdout_utf8(); | ||
diff() | ||
.expected_file("test.stdout") | ||
.actual_text("actual-test-stdout", out) | ||
.normalize( | ||
// Replace all instances of (arbitrary numbers) | ||
// [1.2345 ns/iter (+/- 0.1234)] | ||
// with | ||
// [?? ns/iter (+/- ??)] | ||
r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#, | ||
"?? ns/iter (+/- ??)", | ||
) | ||
// Replace all instances of (arbitrary numbers) | ||
// finished in 8.0000 s | ||
// with | ||
// finished in ?? | ||
.normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??") | ||
.run(); | ||
let out = run_with_args("tests", &["--test-threads=1", "--bench"]).stdout_utf8(); | ||
diff() | ||
.expected_file("bench.stdout") | ||
.actual_text("actual-bench-stdout", out) | ||
.normalize( | ||
r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#, | ||
"?? ns/iter (+/- ??)", | ||
) | ||
.normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??") | ||
.run(); | ||
} |
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,13 @@ | ||
// On windows-gnu, symbol exporting used to fail to export names | ||
// with no_mangle. #72049 brought this feature up to par with msvc, | ||
// and this test checks that the symbol "bar" is successfully exported. | ||
// See https://github.com/rust-lang/rust/issues/50176 | ||
|
||
//@ only-x86_64-pc-windows-gnu | ||
|
||
use run_make_support::{llvm_readobj, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
llvm_readobj().arg("--all").input("libfoo.dll.a").run().assert_stdout_contains("bar"); | ||
} |
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,15 @@ | ||
// In this test, foo links against 32-bit architecture, and then, bar, which depends | ||
// on foo, links against 64-bit architecture, causing a metadata mismatch due to the | ||
// differences in target architectures. This used to cause an internal compiler error, | ||
// now replaced by a clearer normal error message. This test checks that this aforementioned | ||
// error message is used. | ||
// See https://github.com/rust-lang/rust/issues/10814 | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").target("i686-unknown-linux-gnu").run(); | ||
rustc().input("bar.rs").target("x86_64-unknown-linux-gnu").run_fail().assert_stderr_contains( | ||
r#"couldn't find crate `foo` with expected target triple x86_64-unknown-linux-gnu"#, | ||
); | ||
} |
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,24 @@ | ||
//@ ignore-cross-compile | ||
|
||
use run_make_support::rustc; | ||
|
||
// FIXME: it would be good to check that it's actually the rightmost flags | ||
// that are used when multiple flags are specified, but I can't think of a | ||
// reliable way to check this. | ||
fn main() { | ||
// Test that `-O` and `-C opt-level` can be specified multiple times. | ||
// The rightmost flag will be used over any previous flags. | ||
rustc().arg("-O").arg("-O").input("main.rs").run(); | ||
rustc().arg("-O").arg("-C").arg("opt-level=0").input("main.rs").run(); | ||
rustc().arg("-C").arg("opt-level=0").arg("-O").input("main.rs").run(); | ||
rustc().arg("-C").arg("opt-level=0").arg("-C").arg("opt-level=2").input("main.rs").run(); | ||
rustc().arg("-C").arg("opt-level=2").arg("-C").arg("opt-level=0").input("main.rs").run(); | ||
|
||
// Test that `-g` and `-C debuginfo` can be specified multiple times. | ||
// The rightmost flag will be used over any previous flags. | ||
rustc().arg("-g").arg("-g").input("main.rs").run(); | ||
rustc().arg("-g").arg("-C").arg("debuginfo=0").input("main.rs").run(); | ||
rustc().arg("-C").arg("debuginfo=0").arg("-g").input("main.rs").run(); | ||
rustc().arg("-C").arg("debuginfo=0").arg("-C").arg("debuginfo=2").input("main.rs").run(); | ||
rustc().arg("-C").arg("debuginfo=2").arg("-C").arg("debuginfo=0").input("main.rs").run(); | ||
} |
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,39 @@ | ||
// The information inside a .exe file contains a string of the PDB file name. | ||
// This could be a security concern if the full path was exposed, as it could | ||
// reveal information about the filesystem where the bin was first compiled. | ||
// This should only be overridden by `-Clink-arg=/PDBALTPATH:...` - this test | ||
// checks that no full file paths are exposed and that the override flag is respected. | ||
// See https://github.com/rust-lang/rust/pull/121297 | ||
|
||
//@ only-x86_64-pc-windows-msvc | ||
|
||
use run_make_support::{bin_name, invalid_utf8_contains, invalid_utf8_not_contains, run, rustc}; | ||
|
||
fn main() { | ||
// Test that we don't have the full path to the PDB file in the binary | ||
rustc() | ||
.input("main.rs") | ||
.arg("-g") | ||
.crate_name("my_crate_name") | ||
.crate_type("bin") | ||
.arg("-Cforce-frame-pointers") | ||
.run(); | ||
invalid_utf8_contains(&bin_name("my_crate_name"), "my_crate_name.pdb"); | ||
invalid_utf8_not_contains(&bin_name("my_crate_name"), r#"\my_crate_name.pdb"#); | ||
// Test that backtraces still can find debuginfo by checking that they contain symbol names and | ||
// source locations. | ||
let out = run(&bin_name("my_crate_name")); | ||
out.assert_stdout_contains("my_crate_name::fn_in_backtrace"); | ||
out.assert_stdout_contains("main.rs:15"); | ||
// Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected | ||
rustc() | ||
.input("main.rs") | ||
.arg("-g") | ||
.crate_name("my_crate_name") | ||
.crate_type("bin") | ||
.link_arg("/PDBALTPATH:abcdefg.pdb") | ||
.arg("-Cforce-frame-pointers") | ||
.run(); | ||
invalid_utf8_contains(&bin_name("my_crate_name"), "abcdefg.pdb"); | ||
invalid_utf8_not_contains(&bin_name("my_crate_name"), "my_crate_name.pdb"); | ||
} |
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,12 @@ | ||
// The "pretty-printer" of rustc translates source code into other formats, | ||
// which is useful for debugging. This test checks the "normal" version of | ||
// -Zunpretty, which should format the poorly formatted input.rs into a one-line | ||
// function identical to the one in input.pp. | ||
// See https://github.com/rust-lang/rust/commit/da25539c1ab295ec40261109557dd4526923928c | ||
|
||
use run_make_support::{diff, rustc}; | ||
|
||
fn main() { | ||
rustc().output("input.out").arg("-Zunpretty=normal").input("input.rs").run(); | ||
diff().expected_file("input.out").actual_file("input.pp").run(); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.