diff options
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/abi-efiapi.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/codegen/abi-efiapi.rs b/src/test/codegen/abi-efiapi.rs new file mode 100644 index 00000000000..471f572375a --- /dev/null +++ b/src/test/codegen/abi-efiapi.rs @@ -0,0 +1,20 @@ +// Checks if the correct annotation for the efiapi ABI is passed to llvm. + +// compile-flags: -C no-prepopulate-passes + +#![crate_type = "lib"] +#![feature(abi_efiapi)] + +// CHECK: define win64 i64 @has_efiapi +#[no_mangle] +#[cfg(target_arch = "x86_64")] +pub extern "efiapi" fn has_efiapi(a: i64) -> i64 { + a * 2 +} + +// CHECK: define c i64 @has_efiapi +#[no_mangle] +#[cfg(not(target_arch = "x86_64"))] +pub extern "efiapi" fn has_efiapi(a: i64) -> i64 { + a * 2 +} |
