2019-10-29 00:00:00 +00:00
|
|
|
//@ run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(stable_features)]
|
|
|
|
|
2017-01-14 00:22:47 +00:00
|
|
|
#![feature(cfg_target_feature)]
|
2015-01-31 18:49:12 +00:00
|
|
|
|
2017-01-14 00:22:47 +00:00
|
|
|
#[cfg(any(not(target_arch = "x86"), target_feature = "sse2"))]
|
2015-01-31 18:49:12 +00:00
|
|
|
fn main() {
|
2015-03-24 19:45:11 +00:00
|
|
|
if let Ok(x) = "3.1415".parse::<f64>() {
|
2015-01-31 18:49:12 +00:00
|
|
|
assert_eq!(false, x <= 0.0);
|
|
|
|
}
|
2015-03-24 19:45:11 +00:00
|
|
|
if let Ok(x) = "3.1415".parse::<f64>() {
|
2015-01-31 18:49:12 +00:00
|
|
|
assert_eq!(3.1415, x + 0.0);
|
|
|
|
}
|
2015-03-24 19:45:11 +00:00
|
|
|
if let Ok(mut x) = "3.1415".parse::<f64>() {
|
2015-01-31 18:49:12 +00:00
|
|
|
assert_eq!(8.1415, { x += 5.0; x });
|
|
|
|
}
|
|
|
|
}
|
2017-01-14 00:22:47 +00:00
|
|
|
|
|
|
|
#[cfg(all(target_arch = "x86", not(target_feature = "sse2")))]
|
|
|
|
fn main() {}
|