]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sepcomp/sepcomp-cci.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / sepcomp / sepcomp-cci.rs
1 // run-pass
2 // compile-flags: -C codegen-units=3
3 // aux-build:sepcomp_cci_lib.rs
4
5 // Test accessing cross-crate inlined items from multiple compilation units.
6
7
8 extern crate sepcomp_cci_lib;
9 use sepcomp_cci_lib::{cci_fn, CCI_CONST};
10
11 fn call1() -> usize {
12     cci_fn() + CCI_CONST
13 }
14
15 mod a {
16     use sepcomp_cci_lib::{cci_fn, CCI_CONST};
17     pub fn call2() -> usize {
18         cci_fn() + CCI_CONST
19     }
20 }
21
22 mod b {
23     use sepcomp_cci_lib::{cci_fn, CCI_CONST};
24     pub fn call3() -> usize {
25         cci_fn() + CCI_CONST
26     }
27 }
28
29 fn main() {
30     assert_eq!(call1(), 1234);
31     assert_eq!(a::call2(), 1234);
32     assert_eq!(b::call3(), 1234);
33 }