Index: test/mjsunit/regress/regress-5252.js |
diff --git a/test/mjsunit/regress/regress-5252.js b/test/mjsunit/regress/regress-5252.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..682d3193eacbb49a721d0e8761f81d9c3549867c |
--- /dev/null |
+++ b/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()); |
+})(); |