Skip to content

Commit

Permalink
Print correct values for testcase 134 on all targets
Browse files Browse the repository at this point in the history
Testcase 134 only worked on x86_64 and i386 not on other targets.
  • Loading branch information
hermantb committed Dec 30, 2024
1 parent eef2db7 commit 68000c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tccgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3251,8 +3251,12 @@ static void gen_cast(CType *type)
} else if (sf && dbt == VT_BOOL) {
vtop->c.i = (vtop->c.ld != 0);
} else {
if(sf)
vtop->c.i = vtop->c.ld;
if(sf) {
if (dbt & VT_UNSIGNED)
vtop->c.i = (uint64_t)vtop->c.ld;
else
vtop->c.i = (int64_t)vtop->c.ld;
}
else if (sbt_bt == VT_LLONG || (PTR_SIZE == 8 && sbt == VT_PTR))
;
else if (sbt & VT_UNSIGNED)
Expand Down

0 comments on commit 68000c0

Please sign in to comment.