summaryrefslogtreecommitdiffstats
path: root/tests/ui/extern/extern-methods.rs
blob: 22792c11366ba3dda38e1d4102b264d8f2e661c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// run-pass
// only-x86

trait A {
    extern "fastcall" fn test1(i: i32);
    extern "C" fn test2(i: i32);
}

struct S;
impl S {
    extern "stdcall" fn test3(i: i32) {
        assert_eq!(i, 3);
    }
}

impl A for S {
    extern "fastcall" fn test1(i: i32) {
        assert_eq!(i, 1);
    }
    extern "C" fn test2(i: i32) {
        assert_eq!(i, 2);
    }
}

fn main() {
    <S as A>::test1(1);
    <S as A>::test2(2);
    S::test3(3);
}