summary refs log tree commit diff
path: root/src/test/ui/extern/extern-thiscall.rs
blob: c6ff8a43204de69f99cb12ae4849fe04c5a9ecf3 (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
// run-pass
// ignore-arm
// ignore-aarch64
// ignore-riscv64 thiscall isn't supported

#![feature(abi_thiscall)]

trait A {
    extern "thiscall" fn test1(i: i32);
}

struct S;

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

extern "thiscall" fn test2(i: i32) {
    assert_eq!(i, 2);
}

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