| author | bors <bors@rust-lang.org> 2024-06-29 14:00:29 UTC |
| committer | bors <bors@rust-lang.org> 2024-06-29 14:00:29 UTC |
| log | 19a1d2b404e9f56eb1792cc06ec3c86b5a260b41 |
| tree | d4e5597952dd1006c96da6eaafdad46e2660bd01 |
| parent | f8453359bb30e768a686e5de351c079772c24975 |
| parent | 69f355a74bf54ff088bbf73d3a540f1a4585003d |
Rollup of 7 pull requests
Successful merges:
- #126805 (Migrate `pdb-alt-path`, `mismatching-target-triples` and `mingw-export-call-convention` `run-make` tests to rmake)
- #126995 (Migrate `pretty-print-with-dep-file`, `pretty-print-to-file` and `libtest-padding` `run-make` tests to rmake)
- #127041 (Migrate `run-make/override-aliased-flags` to `rmake.rs`)
- #127072 (docs: say "includes" instead of "does include")
- #127073 (Remove unnecessary SeqCst in `impl fmt::Pointer for AtomicPtr`)
- #127112 (Bootstrap: Don't get output if `lldb --version` errors)
- #127116 (Migrate `run-make/return-non-c-like-enum` to `rmake.rs`)
Failed merges:
- #127050 (Make mtime of reproducible tarballs dependent on git commit)
r? `@ghost`
`@rustbot` modify labels: rollup20 files changed, 203 insertions(+), 124 deletions(-)
library/core/src/sync/atomic.rs+1-1| ... | ... | @@ -3766,7 +3766,7 @@ impl<T> fmt::Debug for AtomicPtr<T> { |
| 3766 | 3766 | #[stable(feature = "atomic_pointer", since = "1.24.0")] |
| 3767 | 3767 | impl<T> fmt::Pointer for AtomicPtr<T> { |
| 3768 | 3768 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 3769 | fmt::Pointer::fmt(&self.load(Ordering::SeqCst), f) | |
| 3769 | fmt::Pointer::fmt(&self.load(Ordering::Relaxed), f) | |
| 3770 | 3770 | } |
| 3771 | 3771 | } |
| 3772 | 3772 |
library/core/src/time.rs+4-4| ... | ... | @@ -842,7 +842,7 @@ impl Duration { |
| 842 | 842 | |
| 843 | 843 | /// Returns the number of seconds contained by this `Duration` as `f64`. |
| 844 | 844 | /// |
| 845 | /// The returned value does include the fractional (nanosecond) part of the duration. | |
| 845 | /// The returned value includes the fractional (nanosecond) part of the duration. | |
| 846 | 846 | /// |
| 847 | 847 | /// # Examples |
| 848 | 848 | /// ``` |
| ... | ... | @@ -861,7 +861,7 @@ impl Duration { |
| 861 | 861 | |
| 862 | 862 | /// Returns the number of seconds contained by this `Duration` as `f32`. |
| 863 | 863 | /// |
| 864 | /// The returned value does include the fractional (nanosecond) part of the duration. | |
| 864 | /// The returned value includes the fractional (nanosecond) part of the duration. | |
| 865 | 865 | /// |
| 866 | 866 | /// # Examples |
| 867 | 867 | /// ``` |
| ... | ... | @@ -880,7 +880,7 @@ impl Duration { |
| 880 | 880 | |
| 881 | 881 | /// Returns the number of milliseconds contained by this `Duration` as `f64`. |
| 882 | 882 | /// |
| 883 | /// The returned value does include the fractional (nanosecond) part of the duration. | |
| 883 | /// The returned value includes the fractional (nanosecond) part of the duration. | |
| 884 | 884 | /// |
| 885 | 885 | /// # Examples |
| 886 | 886 | /// ``` |
| ... | ... | @@ -901,7 +901,7 @@ impl Duration { |
| 901 | 901 | |
| 902 | 902 | /// Returns the number of milliseconds contained by this `Duration` as `f32`. |
| 903 | 903 | /// |
| 904 | /// The returned value does include the fractional (nanosecond) part of the duration. | |
| 904 | /// The returned value includes the fractional (nanosecond) part of the duration. | |
| 905 | 905 | /// |
| 906 | 906 | /// # Examples |
| 907 | 907 | /// ``` |
src/bootstrap/src/core/build_steps/test.rs+14-12| ... | ... | @@ -1817,23 +1817,25 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the |
| 1817 | 1817 | cmd.arg("--gdb").arg(gdb); |
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | let run = |cmd: &mut Command| { | |
| 1821 | cmd.output().map(|output| { | |
| 1822 | String::from_utf8_lossy(&output.stdout) | |
| 1823 | .lines() | |
| 1824 | .next() | |
| 1825 | .unwrap_or_else(|| panic!("{:?} failed {:?}", cmd, output)) | |
| 1826 | .to_string() | |
| 1827 | }) | |
| 1828 | }; | |
| 1829 | ||
| 1830 | 1820 | let lldb_exe = builder.config.lldb.clone().unwrap_or_else(|| PathBuf::from("lldb")); |
| 1831 | 1821 | let lldb_version = Command::new(&lldb_exe) |
| 1832 | 1822 | .arg("--version") |
| 1833 | 1823 | .output() |
| 1834 | .map(|output| String::from_utf8_lossy(&output.stdout).to_string()) | |
| 1835 | .ok(); | |
| 1824 | .map(|output| { | |
| 1825 | (String::from_utf8_lossy(&output.stdout).to_string(), output.status.success()) | |
| 1826 | }) | |
| 1827 | .ok() | |
| 1828 | .and_then(|(output, success)| if success { Some(output) } else { None }); | |
| 1836 | 1829 | if let Some(ref vers) = lldb_version { |
| 1830 | let run = |cmd: &mut Command| { | |
| 1831 | cmd.output().map(|output| { | |
| 1832 | String::from_utf8_lossy(&output.stdout) | |
| 1833 | .lines() | |
| 1834 | .next() | |
| 1835 | .unwrap_or_else(|| panic!("{:?} failed {:?}", cmd, output)) | |
| 1836 | .to_string() | |
| 1837 | }) | |
| 1838 | }; | |
| 1837 | 1839 | cmd.arg("--lldb-version").arg(vers); |
| 1838 | 1840 | let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok(); |
| 1839 | 1841 | if let Some(ref dir) = lldb_python_dir { |
src/tools/tidy/src/allowed_run_make_makefiles.txt-8| ... | ... | @@ -82,7 +82,6 @@ run-make/jobserver-error/Makefile |
| 82 | 82 | run-make/libs-through-symlinks/Makefile |
| 83 | 83 | run-make/libtest-json/Makefile |
| 84 | 84 | run-make/libtest-junit/Makefile |
| 85 | run-make/libtest-padding/Makefile | |
| 86 | 85 | run-make/libtest-thread-limit/Makefile |
| 87 | 86 | run-make/link-cfg/Makefile |
| 88 | 87 | run-make/link-framework/Makefile |
| ... | ... | @@ -100,8 +99,6 @@ run-make/macos-fat-archive/Makefile |
| 100 | 99 | run-make/manual-link/Makefile |
| 101 | 100 | run-make/metadata-dep-info/Makefile |
| 102 | 101 | run-make/min-global-align/Makefile |
| 103 | run-make/mingw-export-call-convention/Makefile | |
| 104 | run-make/mismatching-target-triples/Makefile | |
| 105 | 102 | run-make/missing-crate-dependency/Makefile |
| 106 | 103 | run-make/mixing-libs/Makefile |
| 107 | 104 | run-make/msvc-opt-minsize/Makefile |
| ... | ... | @@ -114,13 +111,11 @@ run-make/obey-crate-type-flag/Makefile |
| 114 | 111 | run-make/optimization-remarks-dir-pgo/Makefile |
| 115 | 112 | run-make/optimization-remarks-dir/Makefile |
| 116 | 113 | run-make/output-type-permutations/Makefile |
| 117 | run-make/override-aliased-flags/Makefile | |
| 118 | 114 | run-make/panic-abort-eh_frame/Makefile |
| 119 | 115 | run-make/pass-linker-flags-flavor/Makefile |
| 120 | 116 | run-make/pass-linker-flags-from-dep/Makefile |
| 121 | 117 | run-make/pass-linker-flags/Makefile |
| 122 | 118 | run-make/pass-non-c-like-enum-to-c/Makefile |
| 123 | run-make/pdb-alt-path/Makefile | |
| 124 | 119 | run-make/pdb-buildinfo-cl-cmd/Makefile |
| 125 | 120 | run-make/pgo-gen-lto/Makefile |
| 126 | 121 | run-make/pgo-gen-no-imp-symbols/Makefile |
| ... | ... | @@ -128,8 +123,6 @@ run-make/pgo-gen/Makefile |
| 128 | 123 | run-make/pgo-indirect-call-promotion/Makefile |
| 129 | 124 | run-make/pgo-use/Makefile |
| 130 | 125 | run-make/pointer-auth-link-with-c/Makefile |
| 131 | run-make/pretty-print-to-file/Makefile | |
| 132 | run-make/pretty-print-with-dep-file/Makefile | |
| 133 | 126 | run-make/print-calling-conventions/Makefile |
| 134 | 127 | run-make/print-target-list/Makefile |
| 135 | 128 | run-make/profile/Makefile |
| ... | ... | @@ -147,7 +140,6 @@ run-make/remap-path-prefix/Makefile |
| 147 | 140 | run-make/reproducible-build-2/Makefile |
| 148 | 141 | run-make/reproducible-build/Makefile |
| 149 | 142 | run-make/return-non-c-like-enum-from-c/Makefile |
| 150 | run-make/return-non-c-like-enum/Makefile | |
| 151 | 143 | run-make/rlib-chain/Makefile |
| 152 | 144 | run-make/rlib-format-packed-bundled-libs-2/Makefile |
| 153 | 145 | run-make/rlib-format-packed-bundled-libs-3/Makefile |
tests/run-make/libtest-padding/Makefile deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | # ignore-cross-compile because we run the compiled code | |
| 2 | # needs-unwind because #[bench] and -Cpanic=abort requires -Zpanic-abort-tests | |
| 3 | include ../tools.mk | |
| 4 | ||
| 5 | NORMALIZE=sed 's%[0-9,\.]\{1,\} ns/iter (+/- [0-9,\.]\{1,\})%?? ns/iter (+/- ??)%' | sed 's%finished in [0-9\.]\{1,\}%finished in ??%' | |
| 6 | ||
| 7 | all: | |
| 8 | 	$(RUSTC) --test tests.rs | |
| 9 | ||
| 10 | 	$(call RUN,tests) --test-threads=1 | $(NORMALIZE) > "$(TMPDIR)"/test.stdout | |
| 11 | 	$(RUSTC_TEST_OP) "$(TMPDIR)"/test.stdout test.stdout | |
| 12 | ||
| 13 | 	$(call RUN,tests) --test-threads=1 --bench | $(NORMALIZE) > "$(TMPDIR)"/bench.stdout | |
| 14 | 	$(RUSTC_TEST_OP) "$(TMPDIR)"/bench.stdout bench.stdout |
tests/run-make/libtest-padding/rmake.rs created+46| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | // Benchmarks, when ran as tests, would cause strange indentations | |
| 2 | // to appear in the output. This was because padding formatting was | |
| 3 | // applied before the conversion from bench to test, and not afterwards. | |
| 4 | // Now that this bug has been fixed in #118548, this test checks that it | |
| 5 | // does not make a resurgence by comparing the output of --bench with an | |
| 6 | // example stdout file. | |
| 7 | // See https://github.com/rust-lang/rust/issues/104092 | |
| 8 | ||
| 9 | //@ ignore-cross-compile | |
| 10 | // Reason: the compiled code is ran | |
| 11 | //@ needs-unwind | |
| 12 | // Reason: #[bench] requires -Z panic-abort-tests | |
| 13 | ||
| 14 | use run_make_support::{diff, run_with_args, rustc}; | |
| 15 | ||
| 16 | fn main() { | |
| 17 | rustc().arg("--test").input("tests.rs").run(); | |
| 18 | let out = run_with_args("tests", &["--test-threads=1"]).stdout_utf8(); | |
| 19 | diff() | |
| 20 | .expected_file("test.stdout") | |
| 21 | .actual_text("actual-test-stdout", out) | |
| 22 | .normalize( | |
| 23 | // Replace all instances of (arbitrary numbers) | |
| 24 | // [1.2345 ns/iter (+/- 0.1234)] | |
| 25 | // with | |
| 26 | // [?? ns/iter (+/- ??)] | |
| 27 | r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#, | |
| 28 | "?? ns/iter (+/- ??)", | |
| 29 | ) | |
| 30 | // Replace all instances of (arbitrary numbers) | |
| 31 | // finished in 8.0000 s | |
| 32 | // with | |
| 33 | // finished in ?? | |
| 34 | .normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??") | |
| 35 | .run(); | |
| 36 | let out = run_with_args("tests", &["--test-threads=1", "--bench"]).stdout_utf8(); | |
| 37 | diff() | |
| 38 | .expected_file("bench.stdout") | |
| 39 | .actual_text("actual-bench-stdout", out) | |
| 40 | .normalize( | |
| 41 | r#"(\d+(?:[.,]\d+)*)\s*ns/iter\s*\(\+/-\s*(\d+(?:[.,]\d+)*)\)"#, | |
| 42 | "?? ns/iter (+/- ??)", | |
| 43 | ) | |
| 44 | .normalize(r#"finished\s+in\s+(\d+(?:\.\d+)*)"#, "finished in ??") | |
| 45 | .run(); | |
| 46 | } |
tests/run-make/mingw-export-call-convention/Makefile deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | # only-windows-gnu | |
| 4 | ||
| 5 | all: | |
| 6 | 	$(RUSTC) foo.rs | |
| 7 | 	# FIXME: we should make sure __stdcall calling convention is used here | |
| 8 | 	# but that only works with LLD right now | |
| 9 | 	nm -g "$(call IMPLIB,foo)" | $(CGREP) bar |
tests/run-make/mingw-export-call-convention/rmake.rs created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | // On windows-gnu, symbol exporting used to fail to export names | |
| 2 | // with no_mangle. #72049 brought this feature up to par with msvc, | |
| 3 | // and this test checks that the symbol "bar" is successfully exported. | |
| 4 | // See https://github.com/rust-lang/rust/issues/50176 | |
| 5 | ||
| 6 | //@ only-x86_64-pc-windows-gnu | |
| 7 | ||
| 8 | use run_make_support::{llvm_readobj, rustc}; | |
| 9 | ||
| 10 | fn main() { | |
| 11 | rustc().input("foo.rs").run(); | |
| 12 | llvm_readobj().arg("--all").input("libfoo.dll.a").run().assert_stdout_contains("bar"); | |
| 13 | } |
tests/run-make/mismatching-target-triples/Makefile deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | # Issue #10814 | |
| 4 | # | |
| 5 | # these are no_std to avoid having to have the standard library or any | |
| 6 | # linkers/assemblers for the relevant platform | |
| 7 | ||
| 8 | all: | |
| 9 | 	$(RUSTC) foo.rs --target=i686-unknown-linux-gnu | |
| 10 | 	$(RUSTC) bar.rs --target=x86_64-unknown-linux-gnu 2>&1 \ | |
| 11 | 		| $(CGREP) 'couldn'"'"'t find crate `foo` with expected target triple x86_64-unknown-linux-gnu' |
tests/run-make/mismatching-target-triples/rmake.rs created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | // In this test, foo links against 32-bit architecture, and then, bar, which depends | |
| 2 | // on foo, links against 64-bit architecture, causing a metadata mismatch due to the | |
| 3 | // differences in target architectures. This used to cause an internal compiler error, | |
| 4 | // now replaced by a clearer normal error message. This test checks that this aforementioned | |
| 5 | // error message is used. | |
| 6 | // See https://github.com/rust-lang/rust/issues/10814 | |
| 7 | ||
| 8 | use run_make_support::rustc; | |
| 9 | ||
| 10 | fn main() { | |
| 11 | rustc().input("foo.rs").target("i686-unknown-linux-gnu").run(); | |
| 12 | rustc().input("bar.rs").target("x86_64-unknown-linux-gnu").run_fail().assert_stderr_contains( | |
| 13 | r#"couldn't find crate `foo` with expected target triple x86_64-unknown-linux-gnu"#, | |
| 14 | ); | |
| 15 | } |
tests/run-make/override-aliased-flags/Makefile deleted-23| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | # ignore-cross-compile | |
| 2 | include ../tools.mk | |
| 3 | ||
| 4 | # FIXME: it would be good to check that it's actually the rightmost flags | |
| 5 | # that are used when multiple flags are specified, but I can't think of a | |
| 6 | # reliable way to check this. | |
| 7 | ||
| 8 | all: | |
| 9 | 	# Test that `-O` and `-C opt-level` can be specified multiple times. | |
| 10 | 	# The rightmost flag will be used over any previous flags. | |
| 11 | 	$(RUSTC) -O -O main.rs | |
| 12 | 	$(RUSTC) -O -C opt-level=0 main.rs | |
| 13 | 	$(RUSTC) -C opt-level=0 -O main.rs | |
| 14 | 	$(RUSTC) -C opt-level=0 -C opt-level=2 main.rs | |
| 15 | 	$(RUSTC) -C opt-level=2 -C opt-level=0 main.rs | |
| 16 | ||
| 17 | 	# Test that `-g` and `-C debuginfo` can be specified multiple times. | |
| 18 | 	# The rightmost flag will be used over any previous flags. | |
| 19 | 	$(RUSTC) -g -g main.rs | |
| 20 | 	$(RUSTC) -g -C debuginfo=0 main.rs | |
| 21 | 	$(RUSTC) -C debuginfo=0 -g main.rs | |
| 22 | 	$(RUSTC) -C debuginfo=0 -C debuginfo=2 main.rs | |
| 23 | 	$(RUSTC) -C debuginfo=2 -C debuginfo=0 main.rs |
tests/run-make/override-aliased-flags/rmake.rs created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | //@ ignore-cross-compile | |
| 2 | ||
| 3 | use run_make_support::rustc; | |
| 4 | ||
| 5 | // FIXME: it would be good to check that it's actually the rightmost flags | |
| 6 | // that are used when multiple flags are specified, but I can't think of a | |
| 7 | // reliable way to check this. | |
| 8 | fn main() { | |
| 9 | // Test that `-O` and `-C opt-level` can be specified multiple times. | |
| 10 | // The rightmost flag will be used over any previous flags. | |
| 11 | rustc().arg("-O").arg("-O").input("main.rs").run(); | |
| 12 | rustc().arg("-O").arg("-C").arg("opt-level=0").input("main.rs").run(); | |
| 13 | rustc().arg("-C").arg("opt-level=0").arg("-O").input("main.rs").run(); | |
| 14 | rustc().arg("-C").arg("opt-level=0").arg("-C").arg("opt-level=2").input("main.rs").run(); | |
| 15 | rustc().arg("-C").arg("opt-level=2").arg("-C").arg("opt-level=0").input("main.rs").run(); | |
| 16 | ||
| 17 | // Test that `-g` and `-C debuginfo` can be specified multiple times. | |
| 18 | // The rightmost flag will be used over any previous flags. | |
| 19 | rustc().arg("-g").arg("-g").input("main.rs").run(); | |
| 20 | rustc().arg("-g").arg("-C").arg("debuginfo=0").input("main.rs").run(); | |
| 21 | rustc().arg("-C").arg("debuginfo=0").arg("-g").input("main.rs").run(); | |
| 22 | rustc().arg("-C").arg("debuginfo=0").arg("-C").arg("debuginfo=2").input("main.rs").run(); | |
| 23 | rustc().arg("-C").arg("debuginfo=2").arg("-C").arg("debuginfo=0").input("main.rs").run(); | |
| 24 | } |
tests/run-make/pdb-alt-path/Makefile deleted-20| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | # only-windows-msvc | |
| 4 | ||
| 5 | all: | |
| 6 | 	# Test that we don't have the full path to the PDB file in the binary | |
| 7 | 	$(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Cforce-frame-pointers | |
| 8 | 	$(CGREP) "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe | |
| 9 | 	$(CGREP) -v "\\my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe | |
| 10 | ||
| 11 | 	# Test that backtraces still can find debuginfo by checking that they contain symbol names and | |
| 12 | 	# source locations. | |
| 13 | 	$(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt | |
| 14 | 	$(CGREP) "my_crate_name::fn_in_backtrace" < $(TMPDIR)/backtrace.txt | |
| 15 | 	$(CGREP) "main.rs:15" < $(TMPDIR)/backtrace.txt | |
| 16 | ||
| 17 | 	# Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected | |
| 18 | 	$(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Clink-arg=/PDBALTPATH:abcdefg.pdb -Cforce-frame-pointers | |
| 19 | 	$(CGREP) "abcdefg.pdb" < $(TMPDIR)/my_crate_name.exe | |
| 20 | 	$(CGREP) -v "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe |
tests/run-make/pdb-alt-path/rmake.rs created+39| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | // The information inside a .exe file contains a string of the PDB file name. | |
| 2 | // This could be a security concern if the full path was exposed, as it could | |
| 3 | // reveal information about the filesystem where the bin was first compiled. | |
| 4 | // This should only be overridden by `-Clink-arg=/PDBALTPATH:...` - this test | |
| 5 | // checks that no full file paths are exposed and that the override flag is respected. | |
| 6 | // See https://github.com/rust-lang/rust/pull/121297 | |
| 7 | ||
| 8 | //@ only-x86_64-pc-windows-msvc | |
| 9 | ||
| 10 | use run_make_support::{bin_name, invalid_utf8_contains, invalid_utf8_not_contains, run, rustc}; | |
| 11 | ||
| 12 | fn main() { | |
| 13 | // Test that we don't have the full path to the PDB file in the binary | |
| 14 | rustc() | |
| 15 | .input("main.rs") | |
| 16 | .arg("-g") | |
| 17 | .crate_name("my_crate_name") | |
| 18 | .crate_type("bin") | |
| 19 | .arg("-Cforce-frame-pointers") | |
| 20 | .run(); | |
| 21 | invalid_utf8_contains(&bin_name("my_crate_name"), "my_crate_name.pdb"); | |
| 22 | invalid_utf8_not_contains(&bin_name("my_crate_name"), r#"\my_crate_name.pdb"#); | |
| 23 | // Test that backtraces still can find debuginfo by checking that they contain symbol names and | |
| 24 | // source locations. | |
| 25 | let out = run(&bin_name("my_crate_name")); | |
| 26 | out.assert_stdout_contains("my_crate_name::fn_in_backtrace"); | |
| 27 | out.assert_stdout_contains("main.rs:15"); | |
| 28 | // Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected | |
| 29 | rustc() | |
| 30 | .input("main.rs") | |
| 31 | .arg("-g") | |
| 32 | .crate_name("my_crate_name") | |
| 33 | .crate_type("bin") | |
| 34 | .link_arg("/PDBALTPATH:abcdefg.pdb") | |
| 35 | .arg("-Cforce-frame-pointers") | |
| 36 | .run(); | |
| 37 | invalid_utf8_contains(&bin_name("my_crate_name"), "abcdefg.pdb"); | |
| 38 | invalid_utf8_not_contains(&bin_name("my_crate_name"), "my_crate_name.pdb"); | |
| 39 | } |
tests/run-make/pretty-print-to-file/Makefile deleted-5| ... | ... | @@ -1,5 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | all: | |
| 4 | 	$(RUSTC) -o $(TMPDIR)/input.out -Zunpretty=normal input.rs | |
| 5 | 	diff -u $(TMPDIR)/input.out input.pp |
tests/run-make/pretty-print-to-file/rmake.rs created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | // The "pretty-printer" of rustc translates source code into other formats, | |
| 2 | // which is useful for debugging. This test checks the "normal" version of | |
| 3 | // -Zunpretty, which should format the poorly formatted input.rs into a one-line | |
| 4 | // function identical to the one in input.pp. | |
| 5 | // See https://github.com/rust-lang/rust/commit/da25539c1ab295ec40261109557dd4526923928c | |
| 6 | ||
| 7 | use run_make_support::{diff, rustc}; | |
| 8 | ||
| 9 | fn main() { | |
| 10 | rustc().output("input.out").arg("-Zunpretty=normal").input("input.rs").run(); | |
| 11 | diff().expected_file("input.out").actual_file("input.pp").run(); | |
| 12 | } |
tests/run-make/pretty-print-with-dep-file/Makefile deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | all: | |
| 4 | 	$(RUSTC) --emit=dep-info -Zunpretty=expanded with-dep.rs | |
| 5 | 	$(CGREP) "with-dep.rs" < $(TMPDIR)/with-dep.d | |
| 6 | 	-rm $(TMPDIR)/with-dep.d | |
| 7 | ||
| 8 | 	$(RUSTC) --emit=dep-info -Zunpretty=normal with-dep.rs | |
| 9 | 	! test -f $(TMPDIR)/with-dep.d |
tests/run-make/pretty-print-with-dep-file/rmake.rs created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | // Passing --emit=dep-info to the Rust compiler should create a .d file... | |
| 2 | // but it failed to do so in Rust 1.69.0 when combined with -Z unpretty=expanded | |
| 3 | // due to a bug. This test checks that -Z unpretty=expanded does not prevent the | |
| 4 | // generation of the dep-info file, and that its -Z unpretty=normal counterpart | |
| 5 | // does not get an unexpected dep-info file. | |
| 6 | // See https://github.com/rust-lang/rust/issues/112898 | |
| 7 | ||
| 8 | use run_make_support::{fs_wrapper, invalid_utf8_contains, rustc}; | |
| 9 | use std::path::Path; | |
| 10 | ||
| 11 | fn main() { | |
| 12 | rustc().emit("dep-info").arg("-Zunpretty=expanded").input("with-dep.rs").run(); | |
| 13 | invalid_utf8_contains("with-dep.d", "with-dep.rs"); | |
| 14 | fs_wrapper::remove_file("with-dep.d"); | |
| 15 | rustc().emit("dep-info").arg("-Zunpretty=normal").input("with-dep.rs").run(); | |
| 16 | assert!(!Path::new("with-dep.d").exists()); | |
| 17 | } |
tests/run-make/return-non-c-like-enum/Makefile deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | # ignore-cross-compile | |
| 2 | include ../tools.mk | |
| 3 | ||
| 4 | all: | |
| 5 | 	$(RUSTC) --crate-type=staticlib nonclike.rs | |
| 6 | 	$(CC) test.c $(call STATICLIB,nonclike) $(call OUT_EXE,test) \ | |
| 7 | 		$(EXTRACFLAGS) $(EXTRACXXFLAGS) | |
| 8 | 	$(call RUN,test) |
tests/run-make/return-non-c-like-enum/rmake.rs created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | // Check that we treat enum variants like union members in call ABIs. | |
| 2 | // Added in #68443. | |
| 3 | // Original issue: #68190. | |
| 4 | ||
| 5 | //@ ignore-cross-compile | |
| 6 | ||
| 7 | use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name}; | |
| 8 | ||
| 9 | fn main() { | |
| 10 | rustc().crate_type("staticlib").input("nonclike.rs").run(); | |
| 11 | cc().input("test.c") | |
| 12 | .arg(&static_lib_name("nonclike")) | |
| 13 | .out_exe("test") | |
| 14 | .args(&extra_c_flags()) | |
| 15 | .args(&extra_cxx_flags()) | |
| 16 | .run(); | |
| 17 | run("test"); | |
| 18 | } |