Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1675)

Unified Diff: runtime/vm/flow_graph_builder_test.cc

Issue 1574363002: Use classifying token position for control flow IR instructions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/ast.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder_test.cc
diff --git a/runtime/vm/flow_graph_builder_test.cc b/runtime/vm/flow_graph_builder_test.cc
index 57d18373970cc45e9274e8326d66afdd11d4bf70..c1e702c74a9acf76366dc2672e40c70a922c4a6e 100644
--- a/runtime/vm/flow_graph_builder_test.cc
+++ b/runtime/vm/flow_graph_builder_test.cc
@@ -537,5 +537,33 @@ TEST_CASE(SourcePosition_BitwiseOperations) {
spt.FuzzyInstructionMatchAt("Return", 9, 3);
}
+
+TEST_CASE(SourcePosition_IfElse) {
+ const char* kScript =
+ "var x = 5;\n"
+ "var y = 5;\n"
+ "main() {\n"
+ " if (x != 0) {\n"
+ " return x;\n"
+ " } else {\n"
+ " return y;\n"
+ " }\n"
+ "}\n";
+
+ SourcePositionTest spt(thread, kScript);
+ spt.BuildGraphFor("main");
+ spt.FuzzyInstructionMatchAt("DebugStepCheck", 3, 5);
+ spt.FuzzyInstructionMatchAt("CheckStackOverflow", 3, 5);
+ spt.FuzzyInstructionMatchAt("LoadStaticField", 4, 7);
+ spt.InstanceCallAt(4, 9, Token::kEQ);
+ spt.FuzzyInstructionMatchAt("Branch if StrictCompare", 4, 9);
+ spt.FuzzyInstructionMatchAt("LoadStaticField", 5, 12);
+ spt.FuzzyInstructionMatchAt("DebugStepCheck", 5, 5);
+ spt.FuzzyInstructionMatchAt("Return", 5, 5);
+ spt.FuzzyInstructionMatchAt("LoadStaticField", 7, 10);
+ spt.FuzzyInstructionMatchAt("DebugStepCheck", 7, 3);
+ spt.FuzzyInstructionMatchAt("Return", 7, 3);
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/ast.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698