test #[naked] with #[link_section = "..."] on windows#154598
test #[naked] with #[link_section = "..."] on windows#154598rust-bors[bot] merged 1 commit intorust-lang:mainfrom
#[naked] with #[link_section = "..."] on windows#154598Conversation
| let section = link_section.unwrap_or_else(|| format!(".text.{asm_name}")); | ||
| writeln!(begin, ".pushsection {},\"xr\"", section).unwrap(); | ||
| writeln!(begin, ".balign {align_bytes}").unwrap(); | ||
| write_linkage(&mut begin).unwrap(); | ||
| writeln!(begin, ".def {asm_name}").unwrap(); | ||
| writeln!(begin, ".scl 2").unwrap(); | ||
| writeln!(begin, ".type 32").unwrap(); | ||
| writeln!(begin, ".endef").unwrap(); | ||
|
|
||
| let section = link_section.unwrap_or_else(|| format!(".text.{asm_name}")); | ||
| writeln!(begin, ".pushsection {},\"xr\"", section).unwrap(); | ||
| write_linkage(&mut begin).unwrap(); | ||
| writeln!(begin, ".balign {align_bytes}").unwrap(); |
There was a problem hiding this comment.
This just got moved up so that .def comes before the .pushsection.
| writeln!(end, ".Lfunc_end_{asm_name}:").unwrap(); | ||
| writeln!(end, ".popsection").unwrap(); |
There was a problem hiding this comment.
LLVM does not emit these, so then we should not need to either
| // Pick a default alignment when the alignment is not explicitly specified. | ||
| let align_bytes = match attrs.alignment { | ||
| Some(align) => align.bytes(), | ||
| None => match asm_binary_format { | ||
| BinaryFormat::Coff => 16, | ||
| _ => 4, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
I don't think this really matters but we may as well match LLVM
|
@bors try jobs=x86_64-mingw-1 |
This comment has been minimized.
This comment has been minimized.
test `#[naked]` with `#[link_section = "..."]` on windows try-job: x86_64-mingw-1
This comment has been minimized.
This comment has been minimized.
f445a7c to
b1287a8
Compare
|
💔 Test for e60d030 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
b1287a8 to
984fb02
Compare
|
@bors try jobs=x86_64-mingw-1 |
test `#[naked]` with `#[link_section = "..."]` on windows try-job: x86_64-mingw-1
This comment has been minimized.
This comment has been minimized.
| // CHECK-LABEL: naked_empty: | ||
| // | ||
| // linux,macos,win: ret | ||
| // linux,macos,win_x86,win_x86: ret |
There was a problem hiding this comment.
You probably meant i686 and x86 here.
There was a problem hiding this comment.
(Not tested)
| // linux,macos,win_x86,win_x86: ret | |
| // linux,macos,win_x86,win_i686: ret |
984fb02 to
72b6825
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
Thanks. @bors r+ |
…uwer Rollup of 6 pull requests Successful merges: - #154912 (Remove `BuiltinLintDiag`) - #154598 (test `#[naked]` with `#[link_section = "..."]` on windows) - #154719 (Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes) - #154057 (Parenthesize block-like expressions in index base of pretty printer) - #154893 (make `expected_literal` positive) - #155002 (Clarify that `core::range` ranges do not have special syntax)
As a part of #147811 I ran into that we actually don't match (current) LLVM output.
r? @mati865