2019-05-06 15:49:31 +00:00
|
|
|
// Copyright 2019 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.
|
|
|
|
|
2019-07-12 07:47:16 +00:00
|
|
|
// Flags: --allow-natives-syntax --no-assert-types
|
2019-05-06 15:49:31 +00:00
|
|
|
|
|
|
|
// Check that constant-folding of arithmetic results in identical nodes.
|
|
|
|
(function() {
|
2019-06-12 14:00:50 +00:00
|
|
|
function foo(x) {
|
|
|
|
%TurbofanStaticAssert(1 * x == x + 0);
|
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
|
|
|
foo(121);
|
|
|
|
foo(122);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo(123);
|
2019-05-06 15:49:31 +00:00
|
|
|
})();
|