]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/extern-methods.rs
New upstream version 1.14.0+dfsg1
[rustc.git] / src / test / run-pass / extern-methods.rs
CommitLineData
c34b1796
AL
1// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
c30ab7b3
SL
11// ignore-arm
12// ignore-aarch64
13
9346a6ac 14trait A {
c34b1796
AL
15 extern "fastcall" fn test1(i: i32);
16 extern fn test2(i: i32);
17}
18
19struct S;
20impl S {
21 extern "stdcall" fn test3(i: i32) {
22 assert_eq!(i, 3);
23 }
24}
25
26impl A for S {
27 extern "fastcall" fn test1(i: i32) {
28 assert_eq!(i, 1);
29 }
30 extern fn test2(i: i32) {
31 assert_eq!(i, 2);
32 }
33}
34
35fn main() {
36 <S as A>::test1(1);
37 <S as A>::test2(2);
38 S::test3(3);
39}