H8/300: sim: testsuite: Use the correct file descriptor for stdout.
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
Commit Message
This is obviously a typo, because the file descriptor for stdout is 1 on
both Linux and Windows. As a result, the test cases returned nothing
on Windows, i.e. neither "pass" nor "fail". Which, BTW, raises the
question of why 0 works on Linux. For over 20 years...
Signed-off-by: Jan Dubiec <jdx@o2.pl>
---
sim/testsuite/h8300/testutils.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Sat, Aug 22, 2026 at 05:02:39AM +0200, Jan Dubiec wrote:
> This is obviously a typo, because the file descriptor for stdout is 1 on
> both Linux and Windows. As a result, the test cases returned nothing
> on Windows, i.e. neither "pass" nor "fail". Which, BTW, raises the
> question of why 0 works on Linux. For over 20 years...
sim belongs to the gdb project, not binutils.
On 22.08.2026 11:27, Alan Modra wrote:
> On Sat, Aug 22, 2026 at 05:02:39AM +0200, Jan Dubiec wrote:
>> This is obviously a typo, because the file descriptor for stdout is 1 on
>> both Linux and Windows. As a result, the test cases returned nothing
>> on Windows, i.e. neither "pass" nor "fail". Which, BTW, raises the
>> question of why 0 works on Linux. For over 20 years...
>
> sim belongs to the gdb project, not binutils.
>
Thanks for pointing that out. The patch has already been posted to the
correct list:
https://sourceware.org/pipermail/gdb-patches/2026-August/229687.html.
/J.D.
@@ -85,7 +85,7 @@ _main:
; Output "pass\n"
.macro pass
- mov.w #0, r0 ; fd == stdout
+ mov.w #1, r0 ; fd == stdout
.if (sim_cpu == h8300)
mov.w #pass_str, r1 ; buf == "pass\n"
mov.w #5, r2 ; len == 5
@@ -98,7 +98,7 @@ _main:
; Output "fail\n"
.macro fail
- mov.w #0, r0 ; fd == stdout
+ mov.w #1, r0 ; fd == stdout
.if (sim_cpu == h8300)
mov.w #fail_str, r1 ; buf == "fail\n"
mov.w #5, r2 ; len == 5