This is not quite standard, as everything returns, but usually it is in RAX. In your example, if t_test :: i and t_test :: c are the only members of t_test and no more than 32 bits, the whole structure can fit into a 64-bit register, so it just returns values ββdirectly through RAX, and usually things that can fit in 2 registers, return to RAX: RDX (or RDX: RAX, I forget the general order).
For more than two registers, the hidden pointer parameter is usually used, passed as the first parameter that points to the object in the calling function (usually the one to which the return value is directly assigned). This object is then written before returning from the called function (usually copied from the local structure used in the called function), and usually the same pointer that was passed is returned to RAX.
EAX / EDX can be replaced with RAX / RDX on x86 32-bit systems.
With conventions that pass the "this" pointer on the stack (for example, standard x86 GCC conventions), the return pointer is usually passed as a hidden second parameter, not the first.
source share