]>
Commit | Line | Data |
---|---|---|
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 | ||
ee023bcb | 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"] | |
13 | trait Sized {} | |
14 | #[lang = "copy"] | |
15 | trait Copy {} | |
32a655c1 | 16 | |
abe05a73 | 17 | pub mod tests { |
e1599b0c | 18 | // CHECK: @f1(i32 inreg %_1, i32 inreg %_2, i32 %_3) |
32a655c1 | 19 | #[no_mangle] |
abe05a73 | 20 | pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {} |
32a655c1 | 21 | |
e1599b0c | 22 | // CHECK: @f2(i32* inreg %_1, i32* inreg %_2, i32* %_3) |
32a655c1 | 23 | #[no_mangle] |
abe05a73 | 24 | pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {} |
32a655c1 | 25 | |
e1599b0c | 26 | // CHECK: @f3(float %_1, i32 inreg %_2, i32 inreg %_3, i32 %_4) |
32a655c1 | 27 | #[no_mangle] |
abe05a73 | 28 | pub extern "fastcall" fn f3(_: f32, _: i32, _: i32, _: i32) {} |
32a655c1 | 29 | |
e1599b0c | 30 | // CHECK: @f4(i32 inreg %_1, float %_2, i32 inreg %_3, i32 %_4) |
32a655c1 | 31 | #[no_mangle] |
abe05a73 | 32 | pub extern "fastcall" fn f4(_: i32, _: f32, _: i32, _: i32) {} |
32a655c1 | 33 | |
e1599b0c | 34 | // CHECK: @f5(i64 %_1, i32 %_2) |
32a655c1 | 35 | #[no_mangle] |
abe05a73 | 36 | pub extern "fastcall" fn f5(_: i64, _: i32) {} |
32a655c1 | 37 | |
5099ac24 | 38 | // CHECK: @f6(i1 inreg noundef zeroext %_1, i32 inreg %_2, i32 %_3) |
32a655c1 | 39 | #[no_mangle] |
abe05a73 | 40 | pub extern "fastcall" fn f6(_: bool, _: i32, _: i32) {} |
32a655c1 | 41 | } |