Skip to content

Commit 84b0922

Browse files
Rollup merge of #126712 - Oneirical:bootest-constestllation, r=jieyouxu
Migrate `relocation-model`, `error-writing-dependencies` and `crate-name-priority` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Needs MSVC try-job due to #28026, almost guaranteed to fail, but let's see anyways. try-job: aarch64-gnu `/* try-job: x86_64-msvc */` try-job: x86_64-apple-1 try-job: armhf-gnu try-job: test-various
2 parents e7956cd + 3c0a4bc commit 84b0922

File tree

7 files changed

+59
-43
lines changed

7 files changed

+59
-43
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ run-make/compiler-lookup-paths-2/Makefile
1414
run-make/compiler-lookup-paths/Makefile
1515
run-make/compiler-rt-works-on-mingw/Makefile
1616
run-make/crate-hash-rustc-version/Makefile
17-
run-make/crate-name-priority/Makefile
1817
run-make/cross-lang-lto-clang/Makefile
1918
run-make/cross-lang-lto-pgo-smoketest/Makefile
2019
run-make/cross-lang-lto-upstream-rlibs/Makefile
@@ -31,7 +30,6 @@ run-make/emit-shared-files/Makefile
3130
run-make/emit-stack-sizes/Makefile
3231
run-make/emit-to-stdout/Makefile
3332
run-make/env-dep-info/Makefile
34-
run-make/error-writing-dependencies/Makefile
3533
run-make/export-executable-symbols/Makefile
3634
run-make/extern-diff-internal-name/Makefile
3735
run-make/extern-flag-disambiguates/Makefile
@@ -154,7 +152,6 @@ run-make/raw-dylib-inline-cross-dylib/Makefile
154152
run-make/raw-dylib-link-ordinal/Makefile
155153
run-make/raw-dylib-stdcall-ordinal/Makefile
156154
run-make/redundant-libs/Makefile
157-
run-make/relocation-model/Makefile
158155
run-make/relro-levels/Makefile
159156
run-make/remap-path-prefix-dwarf/Makefile
160157
run-make/remap-path-prefix/Makefile

tests/run-make/crate-name-priority/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff 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+
}

tests/run-make/error-writing-dependencies/Makefile

-8
This file was deleted.
Original file line numberDiff line numberDiff 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+
}

tests/run-make/relocation-model/Makefile

-20
This file was deleted.
+24
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)