LLVM supports passing&#x2F;returning structs (I&#x27;m using 3.8.1): <a href="https:&#x2F;&#x2F;ghostbin.com&#x2F;paste&#x2F;ozsh3" rel="nofollow">https:&#x2F;&#x2F;ghostbin.com&#x2F;paste&#x2F;ozsh3</a><p>Furthermore, the output does match the System V ABI:
<a href="https:&#x2F;&#x2F;ghostbin.com&#x2F;paste&#x2F;4a5ms" rel="nofollow">https:&#x2F;&#x2F;ghostbin.com&#x2F;paste&#x2F;4a5ms</a><p>Notice how the struct is placed on the stack and the pointer to it is placed in %rdi for call&#x2F;return. If you reduce the number of i32&#x27;s in the struct to 3, the struct&#x27;s fields are passed via registers since the type fewer than four eightbytes.<p>My older clang does indeed produce wonky LLVM IR code that seems to try and do this classification in the frontend, so ABI compatibility may have been a problem in the past, but I&#x27;m not convinced it&#x27;s a problem in current versions of LLVM.