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

Side by Side Diff: tests/standalone/int_list_test.dart

Issue 420503003: Add test for issue 20190. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4 //
5 // Dart Mint representations and type propagation issue.
6 // Testing Int32List and Uint32List loads.
7 //
8 // VMOptions=--optimization-counter-threshold=5 --no-use-osr
9
10 import 'dart:typed_data';
11 import "package:expect/expect.dart";
12
13 main() {
14 var a = new Uint32List(100);
15 a[2] = 3;
16 var res = sumIt1(a, 2);
17 Expect.equals(3 * 10, res);
18 res = sumIt1(a, 2);
19 Expect.equals(3 * 10, res);
20 a = new Int32List(100);
21 a[2] = 3;
22 res = sumIt2(a, 2);
23 Expect.equals(3 * 10, res);
24 res = sumIt2(a, 2);
25 Expect.equals(3 * 10, res);
26 }
27
28 sumIt1(Uint32List a, int n) {
29 var sum = 0;
30 for (int i = 0; i < 10; i++) {
31 sum += a[n];
32 }
33 return sum;
34 }
35
36 sumIt2(Int32List a, int n) {
37 var sum = 0;
38 for (int i = 0; i < 10; i++) {
39 sum += a[n];
40 }
41 return sum;
42 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698