mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
fromrangeiter-overflow-checks: accept optional signext for argument
On some targets such as LoongArch64 and RISCV64, the ABI requires sign-extension for 32-bit integer arguments, so LLVM may emit the `signext` attribute for the `%range` parameter. The existing CHECK pattern required the argument to be exactly `i32 noundef %range`, causing the test to fail on those targets. Allow an optional `signext` attribute in the CHECK pattern so the test passes consistently across architectures without affecting the intended codegen validation.
This commit is contained in:
@@ -19,7 +19,7 @@ pub unsafe fn rangefrom_increments(range: RangeFrom<i32>) -> RangeFrom<i32> {
|
||||
// Iterator is contained entirely within this function, so the optimizer should
|
||||
// be able to see that `exhausted` is never set and optimize out any branches.
|
||||
|
||||
// CHECK: i32 noundef %range
|
||||
// CHECK: i32 noundef {{(signext )?}}%range
|
||||
// DEBUG: switch i32 %range
|
||||
// DEBUG: call core::panicking::panic_const::panic_const_add_overflow
|
||||
// DEBUG: unreachable
|
||||
|
||||
Reference in New Issue
Block a user