2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2014-08-01 17:45:24 -05:00
|
|
|
// compile-flags: -C codegen-units=3
|
|
|
|
// aux-build:sepcomp_cci_lib.rs
|
|
|
|
|
|
|
|
// Test accessing cross-crate inlined items from multiple compilation units.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2014-08-01 17:45:24 -05:00
|
|
|
extern crate sepcomp_cci_lib;
|
2015-09-25 04:44:36 -05:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2014-08-01 17:45:24 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn call1() -> usize {
|
2015-09-25 04:44:36 -05:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 17:45:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
mod a {
|
2015-09-25 04:44:36 -05:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2015-03-25 19:06:52 -05:00
|
|
|
pub fn call2() -> usize {
|
2015-09-25 04:44:36 -05:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 17:45:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
2015-09-25 04:44:36 -05:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2015-03-25 19:06:52 -05:00
|
|
|
pub fn call3() -> usize {
|
2015-09-25 04:44:36 -05:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 17:45:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(call1(), 1234);
|
|
|
|
assert_eq!(a::call2(), 1234);
|
|
|
|
assert_eq!(b::call3(), 1234);
|
|
|
|
}
|