]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/sepcomp/sepcomp-extern.rs
move raw span to tt reader
[rust.git] / src / test / run-pass / sepcomp / sepcomp-extern.rs
1 // run-pass
2 // ignore-bitrig
3 // compile-flags: -C codegen-units=3
4 // aux-build:sepcomp-extern-lib.rs
5
6 // Test accessing external items from multiple compilation units.
7
8 extern crate sepcomp_extern_lib;
9
10 extern {
11     fn foo() -> usize;
12 }
13
14 fn call1() -> usize {
15     unsafe { foo() }
16 }
17
18 mod a {
19     pub fn call2() -> usize {
20         unsafe { ::foo() }
21     }
22 }
23
24 mod b {
25     pub fn call3() -> usize {
26         unsafe { ::foo() }
27     }
28 }
29
30 fn main() {
31     assert_eq!(call1(), 1234);
32     assert_eq!(a::call2(), 1234);
33     assert_eq!(b::call3(), 1234);
34 }