Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,44 @@
// Copyright 2023 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Note: The turboshaft-assert-types is needed (at least for these reproducer
// functions) to reach the VisitInt64XXXWithOverflow during instruction
// selection.
//
// Flags: --allow-natives-syntax --turboshaft-assert-types
function add(a, b) {
return a + b;
}
function sub(a, b) {
return a - b;
}
function mul(a, b) {
return a * b;
}
let int64Max = 9223372036854775807n;
%PrepareFunctionForOptimization(add);
assertEquals(3n, add(1n, 2n));
%OptimizeFunctionOnNextCall(add);
assertEquals(3n, add(1n, 2n));
// This will cause an overflow on the int64.
assertEquals(int64Max + int64Max, add(int64Max, int64Max));
%PrepareFunctionForOptimization(sub);
assertEquals(-1n, sub(1n, 2n));
%OptimizeFunctionOnNextCall(sub);
assertEquals(-1n, sub(1n, 2n));
// This will cause an overflow on the int64.
assertEquals(int64Max + int64Max, sub(int64Max, -int64Max));
%PrepareFunctionForOptimization(mul);
assertEquals(6n, mul(2n, 3n));
%OptimizeFunctionOnNextCall(mul);
assertEquals(6n, mul(2n, 3n));
// This will cause an overflow on the int64.
assertEquals(int64Max * int64Max, mul(int64Max, int64Max));