mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
433da1fc04
They pass fine.
17 lines
225 B
Rust
17 lines
225 B
Rust
#![feature(linkage)]
|
|
|
|
#[no_mangle]
|
|
#[linkage = "external"]
|
|
static BAZ: i32 = 21;
|
|
|
|
#[link(name = "foo", kind = "static")]
|
|
extern "C" {
|
|
fn what() -> i32;
|
|
}
|
|
|
|
fn main() {
|
|
unsafe {
|
|
assert_eq!(what(), BAZ);
|
|
}
|
|
}
|