Index: test/cctest/interpreter/test-bytecode-generator.cc |
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc |
index 74518a7f4ed2ffbd64bbc491eb0a3e8086edc1d3..b51ebca02416d6bc337d51d4b2ab5f2c596a2dcc 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -2149,6 +2149,29 @@ TEST(ClassAndSuperClass) { |
LoadGolden("ClassAndSuperClass.golden")); |
} |
+TEST(Generators) { |
+ bool old_flag = FLAG_ignition_generators; |
+ FLAG_ignition_generators = true; |
+ |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate(), |
+ ConstantPoolType::kMixed); |
+ printer.set_wrap(false); |
+ printer.set_test_function_name("f"); |
+ |
+ const char* snippets[] = { |
+ "function* f() { }", |
+ |
+ "function* f() { yield 42 }", |
+ |
+ "function* f() { for (let x of [42]) yield x }", |
+ }; |
+ |
+ CHECK_EQ(BuildActual(printer, snippets), LoadGolden("Generators.golden")); |
+ |
+ FLAG_ignition_generators = old_flag; |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |