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

Side by Side Diff: tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart

Issue 2984183002: dart2js-kernel: Recognize some List constructors. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Helper to test compilation equivalence between source and .dill based 5 // Helper to test compilation equivalence between source and .dill based
6 // compilation. 6 // compilation.
7 library dart2js.kernel.compile_from_dill_test_helper; 7 library dart2js.kernel.compile_from_dill_test_helper;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 ''' 177 '''
178 }, expectIdenticalOutput: true), 178 }, expectIdenticalOutput: true),
179 const Test(const { 179 const Test(const {
180 'main.dart': ''' 180 'main.dart': '''
181 class _Marker { const _Marker(); } 181 class _Marker { const _Marker(); }
182 const _MARKER = const _Marker(); 182 const _MARKER = const _Marker();
183 class Thing<X> { 183 class Thing<X> {
184 Thing([length = _MARKER]); 184 Thing([length = _MARKER]);
185 } 185 }
186 foo(x) {
187 print(new List(x).length);
188 }
186 main() { 189 main() {
187 print(new Thing<String>(100)); 190 print(new Thing<String>(100));
191
192 print(new List());
193 print(new List(4));
194 foo(3);
195 foo(4);
188 } 196 }
189 ''' 197 '''
190 }, expectIdenticalOutput: true), 198 }, expectIdenticalOutput: true),
191 ]; 199 ];
192 200
193 enum ResultKind { crashes, errors, warnings, success, failure } 201 enum ResultKind { crashes, errors, warnings, success, failure }
194 202
195 const List<String> commonOptions = const <String>[ 203 const List<String> commonOptions = const <String>[
196 Flags.disableTypeInference, 204 Flags.disableTypeInference,
197 Flags.disableInlining, 205 Flags.disableInlining,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; 359 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType];
352 checkSets(map1.keys, map2.keys, 'output', equality); 360 checkSets(map1.keys, map2.keys, 'output', equality);
353 map1.forEach((String name, BufferedOutputSink output1) { 361 map1.forEach((String name, BufferedOutputSink output1) {
354 BufferedOutputSink output2 = map2[name]; 362 BufferedOutputSink output2 = map2[name];
355 Expect.stringEquals(output1.text, output2.text); 363 Expect.stringEquals(output1.text, output2.text);
356 }); 364 });
357 }); 365 });
358 } 366 }
359 return ResultKind.success; 367 return ResultKind.success;
360 } 368 }
OLDNEW
« pkg/compiler/lib/src/ssa/builder_kernel.dart ('K') | « pkg/compiler/lib/src/ssa/graph_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698