Tests FFI calls with types that have unique ABI handling rules.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
This suite focuses on C types that are not handled as simple primitives by the target ABI. These often involve legacy hardware (like the x87 FPU) or require values to be split across multiple registers.
It covers two main categories of special types:
- **
long double
:** On the System V x64 ABI (Linux/BSD), this is an 80-bit extended-precision type passed on the x87 FPU stack, not in SSE/XMM registers. On AArch64, it's a 128-bit type passed in a full Q-register. This test verifies these special-case mechanisms for both passing and returning the type.
- **
__int128_t
/ __uint128_t
:** These 128-bit integers are a non-standard compiler extension (not available on MSVC). They are too large for a single GPR and are passed/returned in a register pair (e.g., RAX:RDX on SysV, X0:X1 on AArch64). This test verifies that the library correctly splits and reassembles these large integer values for both forward and reverse FFI calls.