1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
15 assert!((!(() != ())));
16 assert!((!(() < ())));
18 assert!((!(() > ())));
23 assert!((!(true < false)));
24 assert!((!(true <= false)));
25 assert!((true > false));
26 assert!((true >= false));
28 assert!((false < true));
29 assert!((false <= true));
30 assert!((!(false > true)));
31 assert!((!(false >= true)));
33 // Bools support bitwise binops
34 assert_eq!(false & false, false);
35 assert_eq!(true & false, false);
36 assert_eq!(true & true, true);
37 assert_eq!(false | false, false);
38 assert_eq!(true | false, true);
39 assert_eq!(true | true, true);
40 assert_eq!(false ^ false, false);
41 assert_eq!(true ^ false, true);
42 assert_eq!(true ^ true, false);
47 let p1: *const u8 = ::std::mem::transmute(0_usize);
48 let p2: *const u8 = ::std::mem::transmute(0_usize);
49 let p3: *const u8 = ::std::mem::transmute(1_usize);
62 #[derive(PartialEq, Debug)]
68 fn p(x: isize, y: isize) -> p {
80 println!("q = {:x}, r = {:x}",
81 (::std::mem::transmute::<*const p, usize>(&q)),
82 (::std::mem::transmute::<*const p, usize>(&r)));
86 assert!((r.y != q.y));