]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-abi.rs
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / feature-gates / feature-gate-abi.rs
1 // Copyright 2016 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 // ignore-tidy-linelength
11 // gate-test-intrinsics
12 // gate-test-platform_intrinsics
13 // gate-test-abi_vectorcall
14 // gate-test-abi_thiscall
15 // gate-test-abi_ptx
16 // gate-test-abi_x86_interrupt
17 // gate-test-abi_amdgpu_kernel
18
19 // Functions
20 extern "rust-intrinsic" fn f1() {} //~ ERROR intrinsics are subject to change
21 extern "platform-intrinsic" fn f2() {} //~ ERROR platform intrinsics are experimental
22 extern "vectorcall" fn f3() {} //~ ERROR vectorcall is experimental and subject to change
23 extern "rust-call" fn f4() {} //~ ERROR rust-call ABI is subject to change
24 extern "msp430-interrupt" fn f5() {} //~ ERROR msp430-interrupt ABI is experimental
25 extern "ptx-kernel" fn f6() {} //~ ERROR PTX ABIs are experimental and subject to change
26 extern "x86-interrupt" fn f7() {} //~ ERROR x86-interrupt ABI is experimental
27 extern "thiscall" fn f8() {} //~ ERROR thiscall is experimental and subject to change
28 extern "amdgpu-kernel" fn f9() {} //~ ERROR amdgpu-kernel ABI is experimental and subject to change
29
30 // Methods in trait definition
31 trait Tr {
32     extern "rust-intrinsic" fn m1(); //~ ERROR intrinsics are subject to change
33     extern "platform-intrinsic" fn m2(); //~ ERROR platform intrinsics are experimental
34     extern "vectorcall" fn m3(); //~ ERROR vectorcall is experimental and subject to change
35     extern "rust-call" fn m4(); //~ ERROR rust-call ABI is subject to change
36     extern "msp430-interrupt" fn m5(); //~ ERROR msp430-interrupt ABI is experimental
37     extern "ptx-kernel" fn m6(); //~ ERROR PTX ABIs are experimental and subject to change
38     extern "x86-interrupt" fn m7(); //~ ERROR x86-interrupt ABI is experimental
39     extern "thiscall" fn m8(); //~ ERROR thiscall is experimental and subject to change
40     extern "amdgpu-kernel" fn m9(); //~ ERROR amdgpu-kernel ABI is experimental and subject to change
41
42     extern "rust-intrinsic" fn dm1() {} //~ ERROR intrinsics are subject to change
43     extern "platform-intrinsic" fn dm2() {} //~ ERROR platform intrinsics are experimental
44     extern "vectorcall" fn dm3() {} //~ ERROR vectorcall is experimental and subject to change
45     extern "rust-call" fn dm4() {} //~ ERROR rust-call ABI is subject to change
46     extern "msp430-interrupt" fn dm5() {} //~ ERROR msp430-interrupt ABI is experimental
47     extern "ptx-kernel" fn dm6() {} //~ ERROR PTX ABIs are experimental and subject to change
48     extern "x86-interrupt" fn dm7() {} //~ ERROR x86-interrupt ABI is experimental
49     extern "thiscall" fn dm8() {} //~ ERROR thiscall is experimental and subject to change
50     extern "amdgpu-kernel" fn dm9() {} //~ ERROR amdgpu-kernel ABI is experimental and subject to change
51 }
52
53 struct S;
54
55 // Methods in trait impl
56 impl Tr for S {
57     extern "rust-intrinsic" fn m1() {} //~ ERROR intrinsics are subject to change
58     extern "platform-intrinsic" fn m2() {} //~ ERROR platform intrinsics are experimental
59     extern "vectorcall" fn m3() {} //~ ERROR vectorcall is experimental and subject to change
60     extern "rust-call" fn m4() {} //~ ERROR rust-call ABI is subject to change
61     extern "msp430-interrupt" fn m5() {} //~ ERROR msp430-interrupt ABI is experimental
62     extern "ptx-kernel" fn m6() {} //~ ERROR PTX ABIs are experimental and subject to change
63     extern "x86-interrupt" fn m7() {} //~ ERROR x86-interrupt ABI is experimental
64     extern "thiscall" fn m8() {} //~ ERROR thiscall is experimental and subject to change
65     extern "amdgpu-kernel" fn m9() {} //~ ERROR amdgpu-kernel ABI is experimental and subject to change
66 }
67
68 // Methods in inherent impl
69 impl S {
70     extern "rust-intrinsic" fn im1() {} //~ ERROR intrinsics are subject to change
71     extern "platform-intrinsic" fn im2() {} //~ ERROR platform intrinsics are experimental
72     extern "vectorcall" fn im3() {} //~ ERROR vectorcall is experimental and subject to change
73     extern "rust-call" fn im4() {} //~ ERROR rust-call ABI is subject to change
74     extern "msp430-interrupt" fn im5() {} //~ ERROR msp430-interrupt ABI is experimental
75     extern "ptx-kernel" fn im6() {} //~ ERROR PTX ABIs are experimental and subject to change
76     extern "x86-interrupt" fn im7() {} //~ ERROR x86-interrupt ABI is experimental
77     extern "thiscall" fn im8() {} //~ ERROR thiscall is experimental and subject to change
78     extern "amdgpu-kernel" fn im9() {} //~ ERROR amdgpu-kernel ABI is experimental and subject to change
79 }
80
81 // Function pointer types
82 type A1 = extern "rust-intrinsic" fn(); //~ ERROR intrinsics are subject to change
83 type A2 = extern "platform-intrinsic" fn(); //~ ERROR platform intrinsics are experimental
84 type A3 = extern "vectorcall" fn(); //~ ERROR vectorcall is experimental and subject to change
85 type A4 = extern "rust-call" fn(); //~ ERROR rust-call ABI is subject to change
86 type A5 = extern "msp430-interrupt" fn(); //~ ERROR msp430-interrupt ABI is experimental
87 type A6 = extern "ptx-kernel" fn (); //~ ERROR PTX ABIs are experimental and subject to change
88 type A7 = extern "x86-interrupt" fn(); //~ ERROR x86-interrupt ABI is experimental
89 type A8 = extern "thiscall" fn(); //~ ERROR thiscall is experimental and subject to change
90 type A9 = extern "amdgpu-kernel" fn(); //~ ERROR amdgpu-kernel ABI is experimental and subject to change
91
92 // Foreign modules
93 extern "rust-intrinsic" {} //~ ERROR intrinsics are subject to change
94 extern "platform-intrinsic" {} //~ ERROR platform intrinsics are experimental
95 extern "vectorcall" {} //~ ERROR vectorcall is experimental and subject to change
96 extern "rust-call" {} //~ ERROR rust-call ABI is subject to change
97 extern "msp430-interrupt" {} //~ ERROR msp430-interrupt ABI is experimental
98 extern "ptx-kernel" {} //~ ERROR PTX ABIs are experimental and subject to change
99 extern "x86-interrupt" {} //~ ERROR x86-interrupt ABI is experimental
100 extern "thiscall" {} //~ ERROR thiscall is experimental and subject to change
101 extern "amdgpu-kernel" {} //~ ERROR amdgpu-kernel ABI is experimental and subject to change
102
103 fn main() {}