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