diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/issues/issue-50811.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/issues/issue-50811.rs')
-rw-r--r-- | src/test/ui/issues/issue-50811.rs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/test/ui/issues/issue-50811.rs b/src/test/ui/issues/issue-50811.rs deleted file mode 100644 index 683c85604..000000000 --- a/src/test/ui/issues/issue-50811.rs +++ /dev/null @@ -1,55 +0,0 @@ -// run-pass -#![feature(test)] - -extern crate test; - -use std::mem::size_of; -use test::black_box; - -// Ensure the const-eval result and runtime result of float comparison are equivalent. - -macro_rules! compare { - ($op:tt) => { - compare!( - [f64::NEG_INFINITY, -f64::MAX, -1.0, -0.0, 0.0, 1.0, f64::MAX, f64::INFINITY, f64::NAN], - $op - ); - }; - ([$($lhs:expr),+], $op:tt) => { - $(compare!( - $lhs, - $op, - [f64::NEG_INFINITY, -f64::MAX, -1.0, -0.0, 0.0, 1.0, f64::MAX, f64::INFINITY, f64::NAN] - );)+ - }; - ($lhs:expr, $op:tt, [$($rhs:expr),+]) => { - $({ - // Wrap the check in its own function to reduce time needed to borrowck. - fn check() { - static CONST_EVAL: bool = $lhs $op $rhs; - let runtime_eval = black_box($lhs) $op black_box($rhs); - assert_eq!(CONST_EVAL, runtime_eval, stringify!($lhs $op $rhs)); - assert_eq!( - size_of::<[u8; ($lhs $op $rhs) as usize]>(), - runtime_eval as usize, - stringify!($lhs $op $rhs (forced const eval)) - ); - } - check(); - })+ - }; -} - -fn main() { - assert_eq!(0.0/0.0 < 0.0/0.0, false); - assert_eq!(0.0/0.0 > 0.0/0.0, false); - assert_eq!(f64::NAN < f64::NAN, false); - assert_eq!(f64::NAN > f64::NAN, false); - - compare!(==); - compare!(!=); - compare!(<); - compare!(<=); - compare!(>); - compare!(>=); -} |