rust/tests/ui/sepcomp/sepcomp-cci.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
644 B
Rust
Raw Normal View History

//@ run-pass
2014-08-02 06:45:24 +08:00
//@ compile-flags: -C codegen-units=3
//@ aux-build:sepcomp_cci_lib.rs
// Test accessing cross-crate inlined items from multiple compilation units.
2014-08-02 06:45:24 +08:00
extern crate sepcomp_cci_lib;
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
2014-08-02 06:45:24 +08:00
fn call1() -> usize {
cci_fn() + CCI_CONST
2014-08-02 06:45:24 +08:00
}
mod a {
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
pub fn call2() -> usize {
cci_fn() + CCI_CONST
2014-08-02 06:45:24 +08:00
}
}
mod b {
use sepcomp_cci_lib::{cci_fn, CCI_CONST};
pub fn call3() -> usize {
cci_fn() + CCI_CONST
2014-08-02 06:45:24 +08:00
}
}
fn main() {
assert_eq!(call1(), 1234);
assert_eq!(a::call2(), 1234);
assert_eq!(b::call3(), 1234);
}