A uint64 bug fix on x86-64

64bit unsigned literal was handled as 32bit integer.
Added a unittest to catch this.
This commit is contained in:
Shinichiro Hamaji 2009-03-15 14:50:38 +09:00 committed by grischka
parent ae607280c5
commit 62e73da612
2 changed files with 3 additions and 1 deletions

View File

@ -1693,6 +1693,8 @@ void longlong_test(void)
a = 68719476720LL;
b = 4294967295LL;
printf("%d %d %d %d\n", a > b, a < b, a >= b, a <= b);
printf("%Ld\n", 0x123456789LLU);
}
void manyarg_test(void)

View File

@ -312,7 +312,7 @@ void load(int r, SValue *sv)
gen_modrm(r, fr, sv->sym, fc);
} else {
if (v == VT_CONST) {
if ((ft & VT_TYPE) == VT_LLONG) {
if ((ft & VT_BTYPE) == VT_LLONG) {
o(0x48);
o(0xb8 + REG_VALUE(r)); /* mov $xx, r */
gen_addr64(fr, sv->sym, sv->c.ull);