diff options
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-5252.js')
-rw-r--r-- | deps/v8/test/mjsunit/regress/regress-5252.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-5252.js b/deps/v8/test/mjsunit/regress/regress-5252.js new file mode 100644 index 0000000000..682d3193ea --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-5252.js @@ -0,0 +1,31 @@ +// Copyright 2016 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 --ignition --ignition-osr --turbo-from-bytecode + +(function TestNonLoopyLoop() { + function f() { + do { + %OptimizeOsr(); + return 23; + } while(false) + } + assertEquals(23, f()); + assertEquals(23, f()); +})(); + +(function TestNonLoopyGenerator() { + function* g() { + do { + %OptimizeOsr(); + yield 23; + yield 42; + } while(false) + return 999; + } + var gen = g(); + assertEquals({ value:23, done:false }, gen.next()); + assertEquals({ value:42, done:false }, gen.next()); + assertEquals({ value:999, done:true }, gen.next()); +})(); |