Rollup merge of #126712 - Oneirical:bootest-constestllation, r=jieyouxu · rust-lang/rust@84b0922 (original) (raw)

7 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ run-make/compiler-lookup-paths-2/Makefile
14 14 run-make/compiler-lookup-paths/Makefile
15 15 run-make/compiler-rt-works-on-mingw/Makefile
16 16 run-make/crate-hash-rustc-version/Makefile
17 -run-make/crate-name-priority/Makefile
18 17 run-make/cross-lang-lto-clang/Makefile
19 18 run-make/cross-lang-lto-pgo-smoketest/Makefile
20 19 run-make/cross-lang-lto-upstream-rlibs/Makefile
@@ -31,7 +30,6 @@ run-make/emit-shared-files/Makefile
31 30 run-make/emit-stack-sizes/Makefile
32 31 run-make/emit-to-stdout/Makefile
33 32 run-make/env-dep-info/Makefile
34 -run-make/error-writing-dependencies/Makefile
35 33 run-make/export-executable-symbols/Makefile
36 34 run-make/extern-diff-internal-name/Makefile
37 35 run-make/extern-flag-disambiguates/Makefile
@@ -154,7 +152,6 @@ run-make/raw-dylib-inline-cross-dylib/Makefile
154 152 run-make/raw-dylib-link-ordinal/Makefile
155 153 run-make/raw-dylib-stdcall-ordinal/Makefile
156 154 run-make/redundant-libs/Makefile
157 -run-make/relocation-model/Makefile
158 155 run-make/relro-levels/Makefile
159 156 run-make/remap-path-prefix-dwarf/Makefile
160 157 run-make/remap-path-prefix/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
1 +// The `crate_name` rustc flag should have higher priority
2 +// over `#![crate_name = "foo"]` defined inside the source code.
3 +// This test has a conflict between crate_names defined in the .rs files
4 +// and the compiler flags, and checks that the flag is favoured each time.
5 +// See https://github.com/rust-lang/rust/pull/15518
6 +
7 +use run_make_support::{bin_name, fs_wrapper, rustc};
8 +
9 +fn main() {
10 +rustc().input("foo.rs").run();
11 + fs_wrapper::remove_file(bin_name("foo"));
12 +rustc().input("foo.rs").crate_name("bar").run();
13 + fs_wrapper::remove_file(bin_name("bar"));
14 +rustc().input("foo1.rs").run();
15 + fs_wrapper::remove_file(bin_name("foo"));
16 +rustc().input("foo1.rs").output(bin_name("bar1")).run();
17 + fs_wrapper::remove_file(bin_name("bar1"));
18 +}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
1 +// Invalid paths passed to rustc used to cause internal compilation errors
2 +// alongside an obscure error message. This was turned into a standard error,
3 +// and this test checks that the cleaner error message is printed instead.
4 +// See https://github.com/rust-lang/rust/issues/13517
5 +
6 +use run_make_support::rustc;
7 +
8 +// NOTE: This cannot be a UI test due to the --out-dir flag, which is
9 +// already present by default in UI testing.
10 +
11 +fn main() {
12 +let out = rustc().input("foo.rs").emit("dep-info").out_dir("foo/bar/baz").run_fail();
13 +// The error message should be informative.
14 + out.assert_stderr_contains("error writing dependencies");
15 +// The filename should appear.
16 + out.assert_stderr_contains("baz");
17 +}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1 +// Generation of position-independent code (PIC) can be altered
2 +// through use of the -C relocation-model rustc flag. This test
3 +// uses varied values with this flag and checks that compilation
4 +// succeeds.
5 +// See https://github.com/rust-lang/rust/pull/13340
6 +
7 +//@ ignore-cross-compile
8 +
9 +use run_make_support::{run, rustc};
10 +
11 +fn main() {
12 +rustc().arg("-Crelocation-model=static").input("foo.rs").run();
13 +run("foo");
14 +rustc().arg("-Crelocation-model=dynamic-no-pic").input("foo.rs").run();
15 +run("foo");
16 +rustc().arg("-Crelocation-model=default").input("foo.rs").run();
17 +run("foo");
18 +rustc()
19 +.arg("-Crelocation-model=dynamic-no-pic")
20 +.crate_type("dylib")
21 +.emit("link,obj")
22 +.input("foo.rs")
23 +.run();
24 +}