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

Unified Diff: tests/compiler/dart2js/gvn_test.dart

Issue 11953047: Fix host checked mode failure. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/gvn_test.dart
===================================================================
--- tests/compiler/dart2js/gvn_test.dart (revision 17449)
+++ tests/compiler/dart2js/gvn_test.dart (working copy)
@@ -23,6 +23,23 @@
}
""";
+// Check that is checks get GVN'ed.
+const String TEST_THREE = r"""
+void foo(a) {
+ print(a is num);
+ print(a is num);
+}
+""";
+
+// Check that instructions that don't have a builtin equivalent can
+// still be GVN'ed.
+const String TEST_FOUR = r"""
+void foo(a) {
+ print(1 >> a);
+ print(1 >> a);
+}
+""";
+
main() {
String generated = compile(TEST_ONE, entry: 'foo');
RegExp regexp = new RegExp(r"1 \+ [a-z]+");
@@ -30,4 +47,10 @@
generated = compile(TEST_TWO, entry: 'foo');
checkNumberOfMatches(new RegExp("length").allMatches(generated).iterator, 1);
+
+ generated = compile(TEST_THREE, entry: 'foo');
+ checkNumberOfMatches(new RegExp("number").allMatches(generated).iterator, 1);
+
+ generated = compile(TEST_FOUR, entry: 'foo');
+ checkNumberOfMatches(new RegExp("shr").allMatches(generated).iterator, 1);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698