Skip to content

Commit

Permalink
Add pointer-sized integer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Jan 4, 2022
1 parent 8fae33d commit 3cd4976
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/ui/simd/intrinsic/generic-as.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,18 @@ fn main() {
assert_eq!(u.0[0], f.0[0] as u8);
assert_eq!(u.0[1], f.0[1] as u8);
}

unsafe {
let f = V::<f64>([f64::MIN, f64::MAX]);
let i: V<isize> = simd_as(f);
assert_eq!(i.0[0], f.0[0] as isize);
assert_eq!(i.0[1], f.0[1] as isize);
}

unsafe {
let f = V::<f64>([f64::MIN, f64::MAX]);
let u: V<usize> = simd_as(f);
assert_eq!(u.0[0], f.0[0] as usize);
assert_eq!(u.0[1], f.0[1] as usize);
}
}

0 comments on commit 3cd4976

Please sign in to comment.