rust/tests/run-pass/bools.rs

30 lines
417 B
Rust
Raw Normal View History

#![crate_type = "lib"]
2016-03-12 21:32:24 -06:00
#![feature(custom_attribute)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn boolean() -> bool {
true
}
#[miri_run]
fn if_false() -> i64 {
2016-03-17 07:39:29 -05:00
let c = false;
if c { 1 } else { 0 }
2016-03-12 21:32:24 -06:00
}
#[miri_run]
fn if_true() -> i64 {
2016-03-17 07:39:29 -05:00
let c = true;
if c { 1 } else { 0 }
2016-03-12 21:32:24 -06:00
}
2016-03-13 05:50:16 -05:00
#[miri_run]
fn match_bool() -> i16 {
let b = true;
match b {
true => 1,
_ => 0,
}
}