rust/tests/run-pass/bools.rs
2016-04-14 14:54:59 +02:00

30 lines
417 B
Rust

#![crate_type = "lib"]
#![feature(custom_attribute)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn boolean() -> bool {
true
}
#[miri_run]
fn if_false() -> i64 {
let c = false;
if c { 1 } else { 0 }
}
#[miri_run]
fn if_true() -> i64 {
let c = true;
if c { 1 } else { 0 }
}
#[miri_run]
fn match_bool() -> i16 {
let b = true;
match b {
true => 1,
_ => 0,
}
}