Repository navigation
Tighten (absence of) return attribute checks in some-abis-do-extend-params-to-32-bits.rs - #164016
Conversation
|
@rustbot blocked (stacked) |
tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs (absence of) return attribute checkssome-abis-do-extend-params-to-32-bits.rs
There was a problem hiding this comment.
I'll note that this entire test feels a bit strange. I sense that, the test evolved over the years and maybe kinda lost the original intention?
|
@jieyouxu The other PR in the stack is merged, I'll review this when you unstack it |
There's some inconsistent formatting, and also patterns in the wrong column when the columns are intended to be * Has sign/zero extension attribute, versus * No sign/zero extension attribute. This is a precursor commit to make things less confusing. The test is still weak for return attributes.
The patterns in
`tests/codegen-llvm/some-abis-do-extend-params-to-32-bits.rs` were
previously too weak as they matched a substring.
Previously, the test uses a pattern like
```
i32 @c_ret_u32()
```
with the intention to check for absence of `zeroext` or `signext` when
the attribute is not expected. However, this is a substring pattern
match, so the pattern would actually match
```
zeroext i32 @c_ret_u32()
```
which is the very attribute the test wants to check the *absence* of.
To fix this, use a stronger pattern
```
define {{(dso_local )?}}i32 @c_ret_u32()
```
that will not match against the presence of `zeroext`/`signext` return
attributes.
289dedd to
b02b177
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. |
|
Rebased. @rustbot ready |
| // aarch64-apple: zeroext i1 @c_ret_bool() | ||
| // aarch64-windows: i1 @c_ret_bool() | ||
| // aarch64-linux: i1 @c_ret_bool() | ||
| // aarch64-windows: define {{(dso_local )?}}i1 @c_ret_bool() |
There was a problem hiding this comment.
NB: the alternative as suggested is to use --implicit-check, but I'm not sure I love that since it feels quite... implicit. See #163917 (comment)
This is noisy but to at least to me a bit more obvious/direct. Happy to go either way tbh. 🤷
|
I think this is a good shoring-up of the test. Somebody else can do something more aggressive if they're determined. @bors r+ |
…saethlin Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs` Follow-up to rust-lang#163917. * Fix some misplaced patterns in extending vs non-extending columns. * Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes. * See rust-lang#163917 (comment) r? @saethlin (or compiler)
…saethlin Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs` Follow-up to rust-lang#163917. * Fix some misplaced patterns in extending vs non-extending columns. * Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes. * See rust-lang#163917 (comment) r? @saethlin (or compiler)
Rollup of 10 pull requests Successful merges: - #163731 (Add bootstrap step to build the TPDE plugin) - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd) - #161698 (Fix rmeta-link metadata not being read on AIX) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
…saethlin Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs` Follow-up to rust-lang#163917. * Fix some misplaced patterns in extending vs non-extending columns. * Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes. * See rust-lang#163917 (comment) r? @saethlin (or compiler)
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
Rollup of 10 pull requests Successful merges: - #161698 (Fix rmeta-link metadata not being read on AIX) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
…saethlin Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs` Follow-up to rust-lang#163917. * Fix some misplaced patterns in extending vs non-extending columns. * Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes. * See rust-lang#163917 (comment) r? @saethlin (or compiler)
…uwer Rollup of 11 pull requests Successful merges: - #162809 (Remap local def ids for deterministic metadata encoding) - #163373 (Canonicalize operands for commutative binary ops) - #164016 (Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs`) - #164259 (std: make SOLID `sockaddr_storage` large enough for IPv6) - #164424 (diagnostic: skip wrong loops when explaining borrow errors) - #138744 (Add methods to TCP and UDP sockets to modify hop limit) - #162444 (Make `std::fs::{File, ReadDir, DirEntry}` always `needs_drop` even when unsupported.) - #163862 (Collect all limit attributes during TyCtxt creation) - #164213 (make the safety documentation consistent in task::LocalWaker) - #164356 (Add missing full stop) - #164374 (core: hint: fix `unlikely`'s example polarity typo)
Rollup merge of #164016 - jieyouxu:jieyouxu/tighten-test, r=saethlin Tighten (absence of) return attribute checks in `some-abis-do-extend-params-to-32-bits.rs` Follow-up to #163917. * Fix some misplaced patterns in extending vs non-extending columns. * Tighten return attribute patterns to actually reject unexpected `zeroext`/`signext` attributes. * See #163917 (comment) r? @saethlin (or compiler)
Follow-up to #163917.
zeroext/signextattributes.r? @saethlin (or compiler)