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 85c1c43874058dbfcc29eb75f95a21baf67504dd..22bd5133c6e7c00c4c5d6ed8aad7d0f3f4d322da 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -2371,6 +2371,27 @@ TEST(NewAndSpread) { |
LoadGolden("NewAndSpread.golden"))); |
} |
+TEST(AsyncFunctions) { |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate()); |
+ printer.set_wrap(false); |
+ printer.set_test_function_name("f"); |
+ |
+ const char* snippets[] = { |
+ "async function f() { }\n" |
+ "f();\n", |
+ |
+ "async function f() { await 42 }\n" |
+ "f();\n", |
+ |
+ "async function f() { for (let x of [42]) await x }\n" |
+ "f();\n", |
+ }; |
+ |
+ CHECK(CompareTexts(BuildActual(printer, snippets), |
+ LoadGolden("AsyncFunctions.golden"))); |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |