blob: c83fc0fbbce74f1d0db36b7f566d2ea35a8a6c75 [file] [log] [blame]
description(
"Tests that our optimization to elide overflow checks understands that if we keep adding huge numbers, we could end up creating a number that is not precisely representable using doubles."
);
function foo(a) {
var x = a;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
x += 281474976710655;
x += 281474976710654;
x += 281474976710653;
x += 281474976710652;
return x | 0
}
dfgShouldBe(foo, "foo(2147483647)", "2147483552");