Skip to content

Commit

Permalink
[Rust-GCC#3141] Unit test for 32-bit machines
Browse files Browse the repository at this point in the history
gcc/testsuite/ChangeLog:

            * rust/compile/issue-3141.rs: Fix for 32-bit machines.

Signed-off-by: Joan Vilardaga <[email protected]>
  • Loading branch information
JoanVC100 committed Sep 10, 2024
1 parent 306c37b commit 3153425
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions gcc/testsuite/rust/compile/issue-3141.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ fn main() {
let _u128_max: u128 = 340282366920938463463374607431768211455;

// isize and usize
let _isize_min: isize = -9223372036854775808;
let _isize_max: isize = 9223372036854775807;

let _usize_min: usize = 0;
let _usize_max: usize = 18446744073709551615;
#[cfg(target_pointer_width = "64")]
{
let _isize_min: isize = 9223372036854775807;
let _isize_max: isize = -9223372036854775808;
let _usize_min: usize = 0;
let _usize_max: usize = 18446744073709551615;
}
#[cfg(target_pointer_width = "32")]
{
let _isize_min: isize = 2147483647;
let _isize_max: isize = -2147483648;
let _usize_min: usize = 0;
let _usize_max: usize = 4294967295;
}

// Floating point
let _f32_min: f32 = -3.40282347E+38f32;
Expand Down

0 comments on commit 3153425

Please sign in to comment.