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.
11 // compile-flags: -C codegen-units=3
13 // Test references to static items across compilation units.
15 fn pad() -> uint { 0 }
20 // Separate compilation always switches to the LLVM module with the fewest
21 // instructions. Make sure we have some instructions in this module so
22 // that `a` and `b` don't go into the same compilation unit.
23 fn pad() -> uint { 0 }
25 pub static THREE: uint = ::ONE + ::a::TWO;
29 fn pad() -> uint { 0 }
31 pub const TWO: uint = ::ONE + ::ONE;
36 assert_eq!(a::TWO, 2);
37 assert_eq!(b::THREE, 3);