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