]> git.proxmox.com Git - rustc.git/blame - tests/codegen/fastcall-inreg.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / codegen / fastcall-inreg.rs
CommitLineData
32a655c1
SL
1// Checks if the "fastcall" calling convention marks function arguments
2// as "inreg" like the C/C++ compilers for the platforms.
3// x86 only.
4
5e7ed085 5// compile-flags: --target i686-unknown-linux-gnu -O -C no-prepopulate-passes
5099ac24 6// needs-llvm-components: x86
32a655c1
SL
7
8#![crate_type = "lib"]
5099ac24
FG
9#![no_core]
10#![feature(no_core, lang_items)]
11
12#[lang = "sized"]
13trait Sized {}
14#[lang = "copy"]
15trait Copy {}
32a655c1 16
abe05a73 17pub mod tests {
9c376795 18 // CHECK: @f1(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
32a655c1 19 #[no_mangle]
abe05a73 20 pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}
32a655c1 21
9c376795 22 // CHECK: @f2({{i32\*|ptr}} inreg noundef %_1, {{i32\*|ptr}} inreg noundef %_2, {{i32\*|ptr}} noundef %_3)
32a655c1 23 #[no_mangle]
abe05a73 24 pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {}
32a655c1 25
9c376795 26 // CHECK: @f3(float noundef %_1, i32 inreg noundef %_2, i32 inreg noundef %_3, i32 noundef %_4)
32a655c1 27 #[no_mangle]
abe05a73 28 pub extern "fastcall" fn f3(_: f32, _: i32, _: i32, _: i32) {}
32a655c1 29
9c376795 30 // CHECK: @f4(i32 inreg noundef %_1, float noundef %_2, i32 inreg noundef %_3, i32 noundef %_4)
32a655c1 31 #[no_mangle]
abe05a73 32 pub extern "fastcall" fn f4(_: i32, _: f32, _: i32, _: i32) {}
32a655c1 33
9c376795 34 // CHECK: @f5(i64 noundef %_1, i32 noundef %_2)
32a655c1 35 #[no_mangle]
abe05a73 36 pub extern "fastcall" fn f5(_: i64, _: i32) {}
32a655c1 37
9c376795 38 // CHECK: @f6(i1 inreg noundef zeroext %_1, i32 inreg noundef %_2, i32 noundef %_3)
32a655c1 39 #[no_mangle]
abe05a73 40 pub extern "fastcall" fn f6(_: bool, _: i32, _: i32) {}
32a655c1 41}