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

Unified Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2366263004: Handle fields with initializers in kernel_impact (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/compiler/lib/src/ssa/kernel_impact.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/kernel/impact_test.dart
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index 2716d53e6bc7430a98b56b80e779ca7a6e0c4f95..bdbddea5ec5116df291f43617ddbfa61a1b40231 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -17,6 +17,7 @@ import 'package:compiler/src/ssa/kernel_impact.dart';
import 'package:compiler/src/serialization/equivalence.dart';
import 'package:compiler/src/universe/feature.dart';
import 'package:compiler/src/universe/use.dart';
+import 'package:expect/expect.dart';
import '../memory_compiler.dart';
import '../serialization/test_helper.dart';
@@ -60,7 +61,13 @@ main() {
testTopLevelFunctionTyped();
testTopLevelFunctionGet();
testTopLevelField();
+ testTopLevelFieldLazy();
+ testTopLevelFieldConst();
+ testTopLevelFieldFinal();
testTopLevelFieldTyped();
+ testTopLevelFieldGeneric1();
+ testTopLevelFieldGeneric2();
+ testTopLevelFieldGeneric3();
testDynamicInvoke(null);
testDynamicGet(null);
testDynamicSet(null);
@@ -173,8 +180,21 @@ testTopLevelFunctionGet() => topLevelFunction1;
var topLevelField;
testTopLevelField() => topLevelField;
+var topLevelFieldLazy = topLevelFunction1(null);
+testTopLevelFieldLazy() => topLevelFieldLazy;
+const topLevelFieldConst = 0;
+testTopLevelFieldConst() => topLevelFieldConst;
+final topLevelFieldFinal = topLevelFunction1(null);
+testTopLevelFieldFinal() => topLevelFieldFinal;
int topLevelFieldTyped;
testTopLevelFieldTyped() => topLevelFieldTyped;
+GenericClass topLevelFieldGeneric1;
+testTopLevelFieldGeneric1() => topLevelFieldGeneric1;
+GenericClass<dynamic, dynamic> topLevelFieldGeneric2;
+testTopLevelFieldGeneric2() => topLevelFieldGeneric2;
+GenericClass<int, String> topLevelFieldGeneric3;
+testTopLevelFieldGeneric3() => topLevelFieldGeneric3;
+
testDynamicInvoke(o) {
o.f1(0);
o.f2(1);
@@ -296,6 +316,7 @@ void checkElement(Compiler compiler, AstElement element) {
ResolutionImpact astImpact = compiler.resolution.getResolutionImpact(element);
astImpact = laxImpact(element, astImpact);
ResolutionImpact kernelImpact = build(compiler, element.resolvedAst);
+ Expect.isNotNull(kernelImpact, 'No impact computed for $element');
testResolutionImpactEquivalence(
astImpact, kernelImpact, const CheckStrategy());
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_impact.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698