summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-1412629.js
blob: 03e67d12fd94daf4d86ce069282913ff8d86962a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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.
//
// Flags: --allow-natives-syntax

function foo(x) {
  return NaN ** x;
}

%PrepareFunctionForOptimization(foo);
assertEquals(NaN, foo(1));
assertEquals(1, foo(0));
assertEquals(1, foo(-0));
%OptimizeFunctionOnNextCall(foo);
assertEquals(NaN, foo(1));
assertEquals(1, foo(0));
assertEquals(1, foo(-0));