rust/tests/ui/box/unit/unique-ffi-symbols.rs

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

17 lines
448 B
Rust
Raw Normal View History

//@ run-pass
2016-03-06 06:17:53 -06:00
// We used to have a __rust_abi shim that resulted in duplicated symbols
// whenever the item path wasn't enough to disambiguate between them.
fn main() {
let a = {
extern "C" fn good() -> i32 { return 0; }
good as extern "C" fn() -> i32
2016-03-06 06:17:53 -06:00
};
let b = {
extern "C" fn good() -> i32 { return 5; }
good as extern "C" fn() -> i32
2016-03-06 06:17:53 -06:00
};
assert!(a != b);
assert_eq!((a(), b()), (0, 5));
}