summaryrefslogtreecommitdiffstats
path: root/tests/ui/box/unit/unique-ffi-symbols.rs
blob: 77b5ead26337a72ece43747368f55d7e2ed743a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
// 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
    };
    let b = {
        extern "C" fn good() -> i32 { return 5; }
        good as extern "C" fn() -> i32
    };

    assert!(a != b);
    assert_eq!((a(), b()), (0, 5));
}