-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate min-global-align
and no-alloc-shim
run-make
tests to rmake
#128407
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,27 @@ | ||
// This test checks that global variables respect the target minimum alignment. | ||
// The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have | ||
// type-alignment of 1, but some targets require greater global alignment. | ||
// See https://github.com/rust-lang/rust/pull/44440 | ||
|
||
//@ only-linux | ||
// Reason: this test is specific to linux, considering compilation is targeted | ||
// towards linux architectures only. | ||
|
||
use run_make_support::{assert_count_is, llvm_components_contain, rfs, rustc}; | ||
|
||
fn main() { | ||
// Most targets are happy with default alignment -- take i686 for example. | ||
if llvm_components_contain("x86") { | ||
rustc().target("i686-unknown-linux-gnu").emit("llvm-ir").input("min_global_align.rs").run(); | ||
assert_count_is(3, rfs::read_to_string("min_global_align.ll"), "align 1"); | ||
} | ||
// SystemZ requires even alignment for PC-relative addressing. | ||
if llvm_components_contain("systemz") { | ||
rustc() | ||
.target("s390x-unknown-linux-gnu") | ||
.emit("llvm-ir") | ||
.input("min_global_align.rs") | ||
.run(); | ||
assert_count_is(3, rfs::read_to_string("min_global_align.ll"), "align 2"); | ||
} | ||
} |
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,55 @@ | ||
// This test checks the compatibility of the interaction between `--emit obj` and | ||
// `#[global_allocator]`, as it is now possible to invoke the latter without the | ||
// allocator shim since #86844. As this feature is unstable, it should fail if | ||
// --cfg check_feature_gate is passed. | ||
// See https://github.com/rust-lang/rust/pull/86844 | ||
|
||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
//@ ignore-msvc | ||
//FIXME(Oneirical): Getting this to work on MSVC requires passing libcmt.lib to CC, | ||
// which is not trivial to do. | ||
// Tracking issue: https://github.com/rust-lang/rust/issues/128602 | ||
// Discussion: https://github.com/rust-lang/rust/pull/128407#discussion_r1702439172 | ||
|
||
use run_make_support::{cc, cwd, has_extension, has_prefix, run, rustc, shallow_find_files}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").crate_type("bin").emit("obj").panic("abort").run(); | ||
let libdir = rustc().print("target-libdir").run().stdout_utf8(); | ||
let libdir = libdir.trim(); | ||
|
||
let alloc_libs = shallow_find_files(&libdir, |path| { | ||
has_prefix(path, "liballoc-") && has_extension(path, "rlib") | ||
}); | ||
let core_libs = shallow_find_files(&libdir, |path| { | ||
has_prefix(path, "libcore-") && has_extension(path, "rlib") | ||
}); | ||
let compiler_builtins_libs = shallow_find_files(libdir, |path| { | ||
has_prefix(path, "libcompiler_builtins") && has_extension(path, "rlib") | ||
}); | ||
|
||
cc().input("foo.o") | ||
.out_exe("foo") | ||
.args(&alloc_libs) | ||
.args(&core_libs) | ||
.args(&compiler_builtins_libs) | ||
.run(); | ||
run("foo"); | ||
|
||
// Check that linking without __rust_no_alloc_shim_is_unstable defined fails | ||
rustc() | ||
.input("foo.rs") | ||
.crate_type("bin") | ||
.emit("obj") | ||
.panic("abort") | ||
.cfg("check_feature_gate") | ||
.run(); | ||
cc().input("foo.o") | ||
.out_exe("foo") | ||
.args(&alloc_libs) | ||
.args(&core_libs) | ||
.args(&compiler_builtins_libs) | ||
.run_fail(); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark (for myself): I wonder if we could try to support revisions in rmake.rs. In ui tests and codegen tests
revisions
also define correspondingcfg
s, maybe we could use them here as well (this remark is for myself).Something like
Just a thought. But handling blessing / properly quarantining revisions would be a pain.