|
From: | Herman ten Brugge |
Subject: | Re: [Tinycc-devel] Questions about commit 5b28165: Fix test 131 for 32 bits targets |
Date: | Fri, 7 Jul 2023 19:29:07 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 |
On 7/7/23 18:15, Ziyao wrote:
Hi, I noticed that test 131 (authored by me) has been modified in commit 5b28165: Fix test 131 for 32 bits targets: struct with two long int members are replaced by long long int ones. Test 131 (return struct in registers) is intended to test whether functions return small structs (maybe passed in registers in some ABIs) are handled properly. long long int on 32bit targets seem to be 8 bytes, right? And AFAIK, many ABIs only pass structs with 2 * WORDLENGTH size in registers (for 32-bit architectures, it is 8-bytes and is equal to the size of a struct with two long int members.) Is this fix necessary?
Your testcode only worked on 64 bits targets. I just fixed it to work on 32 bits targets. We can add extra tests for structures containing int/short/char. These are compatible on 64 and 32 bits. Type long is different on 32 and 64 bits targets so can not be used. See other test cases. Herman
[Prev in Thread] | Current Thread | [Next in Thread] |