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