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.
14 // compile-flags: -C codegen-units=3
16 // Test references to static items across compilation units.
19 fn pad() -> usize { 0 }
24 // Separate compilation always switches to the LLVM module with the fewest
25 // instructions. Make sure we have some instructions in this module so
26 // that `a` and `b` don't go into the same compilation unit.
27 fn pad() -> usize { 0 }
29 pub static THREE: usize = ::ONE + ::a::TWO;
33 fn pad() -> usize { 0 }
35 pub const TWO: usize = ::ONE + ::ONE;
40 assert_eq!(a::TWO, 2);
41 assert_eq!(b::THREE, 3);