-
Notifications
You must be signed in to change notification settings - Fork 14.1k
use cfg_select! to pick assembly in codegen test
#148881
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
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
| { | ||
| naked_asm!("adds r0, r0, r1", "bx lr") | ||
| cfg_select! { | ||
| any(target_arch = "x86_64", target_arch = "x86") => { |
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.
Shouldn't this be any(target_os = "windows", target_os = "linux")?
Seems like the next clause is also the wrong one?
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.
I did change the clause, but I believe that the change is correct. What assembly to use depends on the target architecture, not on the target operating system.
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.
I see. I guess in practice this worked before because we run this test with specific targets... so macOS really was always aarch64, while linux/win was x86_64/x86.
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
//@[linux] needs-llvm-components: x86
//@[win_x86] compile-flags: --target x86_64-pc-windows-gnu
//@[win_x86] needs-llvm-components: x86
//@[win_i686] compile-flags: --target i686-pc-windows-gnu
//@[win_i686] needs-llvm-components: x86
//@[macos] compile-flags: --target aarch64-apple-darwin
//@[macos] needs-llvm-components: aarch64
|
@bors r+ |
Rollup of 7 pull requests Successful merges: - #148703 (Use `overflow_checks` intrinsic so `IterRangeFrom` yields MAX before panicking in debug) - #148881 (use `cfg_select!` to pick assembly in codegen test) - #148911 (Make flags from `*FLAGS*` (such as `RUSTFLAGS`) env. vars. have precedence over flags set by bootstrap) - #148914 (fix incorrect import in `std_detect` on `aarch64-unknown-openbsd`) - #148971 (Document Error::{new,other} as to be avoided in pre_exec) - #148983 (Use rustc target metadata for build-manifest target lists) - #148995 (add must_use to extract_if methods) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #148881 - folkertdev:cfg-select-codegen-naked, r=Mark-Simulacrum use `cfg_select!` to pick assembly in codegen test This makes it a bit easier to see what assembly is actually used.
|
still in queue @bors r- |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#148703 (Use `overflow_checks` intrinsic so `IterRangeFrom` yields MAX before panicking in debug) - rust-lang#148881 (use `cfg_select!` to pick assembly in codegen test) - rust-lang#148911 (Make flags from `*FLAGS*` (such as `RUSTFLAGS`) env. vars. have precedence over flags set by bootstrap) - rust-lang#148914 (fix incorrect import in `std_detect` on `aarch64-unknown-openbsd`) - rust-lang#148971 (Document Error::{new,other} as to be avoided in pre_exec) - rust-lang#148983 (Use rustc target metadata for build-manifest target lists) - rust-lang#148995 (add must_use to extract_if methods) r? `@ghost` `@rustbot` modify labels: rollup
This makes it a bit easier to see what assembly is actually used.