]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/fastcall-inreg.rs
Refactor away `inferred_obligations` from the trait selector
[rust.git] / src / test / codegen / fastcall-inreg.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
11 // Checks if the "fastcall" calling convention marks function arguments
12 // as "inreg" like the C/C++ compilers for the platforms.
13 // x86 only.
14
15 // ignore-aarch64
16 // ignore-aarch64_be
17 // ignore-arm
18 // ignore-armeb
19 // ignore-avr
20 // ignore-bpfel
21 // ignore-bpfeb
22 // ignore-hexagon
23 // ignore-mips
24 // ignore-mipsel
25 // ignore-mips64
26 // ignore-mips64el
27 // ignore-msp430
28 // ignore-powerpc64
29 // ignore-powerpc64le
30 // ignore-powerpc
31 // ignore-r600
32 // ignore-amdgcn
33 // ignore-sparc
34 // ignore-sparcv9
35 // ignore-sparcel
36 // ignore-s390x
37 // ignore-tce
38 // ignore-thumb
39 // ignore-thumbeb
40 // ignore-x86_64
41 // ignore-xcore
42 // ignore-nvptx
43 // ignore-nvptx64
44 // ignore-le32
45 // ignore-le64
46 // ignore-amdil
47 // ignore-amdil64
48 // ignore-hsail
49 // ignore-hsail64
50 // ignore-spir
51 // ignore-spir64
52 // ignore-kalimba
53 // ignore-shave
54 // ignore-wasm32
55 // ignore-wasm64
56 // ignore-emscripten
57
58 // compile-flags: -C no-prepopulate-passes
59
60 #![crate_type = "lib"]
61
62 pub mod tests {
63     // CHECK: @f1(i32 inreg %arg0, i32 inreg %arg1, i32 %arg2)
64     #[no_mangle]
65     pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}
66
67     // CHECK: @f2(i32* inreg %arg0, i32* inreg %arg1, i32* %arg2)
68     #[no_mangle]
69     pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {}
70
71     // CHECK: @f3(float %arg0, i32 inreg %arg1, i32 inreg %arg2, i32 %arg3)
72     #[no_mangle]
73     pub extern "fastcall" fn f3(_: f32, _: i32, _: i32, _: i32) {}
74
75     // CHECK: @f4(i32 inreg %arg0, float %arg1, i32 inreg %arg2, i32 %arg3)
76     #[no_mangle]
77     pub extern "fastcall" fn f4(_: i32, _: f32, _: i32, _: i32) {}
78
79     // CHECK: @f5(i64 %arg0, i32 %arg1)
80     #[no_mangle]
81     pub extern "fastcall" fn f5(_: i64, _: i32) {}
82
83     // CHECK: @f6(i1 inreg zeroext %arg0, i32 inreg %arg1, i32 %arg2)
84     #[no_mangle]
85     pub extern "fastcall" fn f6(_: bool, _: i32, _: i32) {}
86 }