rust/src/test/ui/run-pass/consts/const-contents.rs
Felix S. Klock II 0909e0bf70 Add // run-pass annotations to all the tests under ui/run-pass/.
(I may have accidentally added it to some auxilliary crates as well;
my emacs-macro-based methodology was pretty crude.)
2018-09-06 13:00:26 +02:00

30 lines
836 B
Rust

// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// run-pass
// Issue #570
static lsl : isize = 1 << 2;
static add : isize = 1 + 2;
static addf : f64 = 1.0 + 2.0;
static not : isize = !0;
static notb : bool = !true;
static neg : isize = -(1);
pub fn main() {
assert_eq!(lsl, 4);
assert_eq!(add, 3);
assert_eq!(addf, 3.0);
assert_eq!(not, -1);
assert_eq!(notb, false);
assert_eq!(neg, -1);
}