]>
git.proxmox.com Git - rustc.git/blob - 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.
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.
11 // Checks if the "fastcall" calling convention marks function arguments
12 // as "inreg" like the C/C++ compilers for the platforms.
57 // compile-flags: -C no-prepopulate-passes
59 #![crate_type = "lib"]
62 // CHECK: @f1(i32 inreg %arg0, i32 inreg %arg1, i32 %arg2)
64 pub extern "fastcall" fn f1(_
: i32, _
: i32, _
: i32) {}
66 // CHECK: @f2(i32* inreg %arg0, i32* inreg %arg1, i32* %arg2)
68 pub extern "fastcall" fn f2(_
: *const i32, _
: *const i32, _
: *const i32) {}
70 // CHECK: @f3(float %arg0, i32 inreg %arg1, i32 inreg %arg2, i32 %arg3)
72 pub extern "fastcall" fn f3(_
: f32, _
: i32, _
: i32, _
: i32) {}
74 // CHECK: @f4(i32 inreg %arg0, float %arg1, i32 inreg %arg2, i32 %arg3)
76 pub extern "fastcall" fn f4(_
: i32, _
: f32, _
: i32, _
: i32) {}
78 // CHECK: @f5(i64 %arg0, i32 %arg1)
80 pub extern "fastcall" fn f5(_
: i64, _
: i32) {}
82 // CHECK: @f6(i1 inreg zeroext %arg0, i32 inreg %arg1, i32 %arg2)
84 pub extern "fastcall" fn f6(_
: bool
, _
: i32, _
: i32) {}