2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2014-08-01 22:45:24 +00: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 20:13:15 +00:00
|
|
|
|
2014-08-01 22:45:24 +00:00
|
|
|
extern crate sepcomp_cci_lib;
|
2015-09-25 09:44:36 +00:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2014-08-01 22:45:24 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
fn call1() -> usize {
|
2015-09-25 09:44:36 +00:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 22:45:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mod a {
|
2015-09-25 09:44:36 +00:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2015-03-26 00:06:52 +00:00
|
|
|
pub fn call2() -> usize {
|
2015-09-25 09:44:36 +00:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 22:45:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod b {
|
2015-09-25 09:44:36 +00:00
|
|
|
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
|
2015-03-26 00:06:52 +00:00
|
|
|
pub fn call3() -> usize {
|
2015-09-25 09:44:36 +00:00
|
|
|
cci_fn() + CCI_CONST
|
2014-08-01 22:45:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(call1(), 1234);
|
|
|
|
assert_eq!(a::call2(), 1234);
|
|
|
|
assert_eq!(b::call3(), 1234);
|
|
|
|
}
|