]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/enum-discrim-range-overflow.rs
b45040f6a1c53ee79244add4d4663ac6dbbf1ad6
[rust.git] / src / test / run-pass / enum-discrim-range-overflow.rs
1 // Copyright 2013 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.
4 //
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.
10
11 pub enum E64 {
12     H64 = 0x7FFF_FFFF_FFFF_FFFF,
13     L64 = 0x8000_0000_0000_0000
14 }
15 pub enum E32 {
16     H32 = 0x7FFF_FFFF,
17     L32 = 0x8000_0000
18 }
19
20 pub fn f(e64: E64, e32: E32) -> (bool,bool) {
21     (match e64 {
22         E64::H64 => true,
23         E64::L64 => false
24     },
25      match e32 {
26         E32::H32 => true,
27         E32::L32 => false
28     })
29 }
30
31 pub fn main() { }