rust/tests/run-make/linkage-attr-on-static/bar.rs

17 lines
225 B
Rust
Raw Normal View History

2014-11-11 20:34:18 -06:00
#![feature(linkage)]
#[no_mangle]
#[linkage = "external"]
static BAZ: i32 = 21;
2015-08-26 18:57:56 -05:00
#[link(name = "foo", kind = "static")]
2020-09-01 16:12:52 -05:00
extern "C" {
2014-11-11 20:34:18 -06:00
fn what() -> i32;
}
fn main() {
unsafe {
assert_eq!(what(), BAZ);
}
}