2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2021-11-04 14:30:23 +00:00
|
|
|
//@ only-x86
|
2016-10-25 17:56:36 +00:00
|
|
|
|
2015-04-18 05:12:20 +00:00
|
|
|
trait A {
|
2015-02-19 20:26:13 +00:00
|
|
|
extern "fastcall" fn test1(i: i32);
|
2020-09-01 21:28:11 +00:00
|
|
|
extern "C" fn test2(i: i32);
|
2015-02-19 20:26:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2020-09-01 21:28:11 +00:00
|
|
|
extern "C" fn test2(i: i32) {
|
2015-02-19 20:26:13 +00:00
|
|
|
assert_eq!(i, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
<S as A>::test1(1);
|
|
|
|
<S as A>::test2(2);
|
|
|
|
S::test3(3);
|
|
|
|
}
|