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

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 //
7 // VMOptions=--optimization-counter-threshold=5 --no-use-osr
8
9 import 'dart:typed_data';
10 import "package:expect/expect.dart";
11
12 main() {
13 var a = new Uint32List(100);
14 a[2] = 3;
15 var res = sumIt1(a, 2);
16 Expect.equals(3 * 10, res);
17 res = sumIt1(a, 2);
18 Expect.equals(3 * 10, res);
19 a = new Int32List(100);
hausner 2014/07/24 21:05:45 I guess except for you, nobody would know why you
srdjan 2014/07/24 21:26:58 Adding comment: test Uint32List and Int32List load
20 a[2] = 3;
21 res = sumIt2(a, 2);
22 Expect.equals(3 * 10, res);
23 res = sumIt2(a, 2);
24 Expect.equals(3 * 10, res);
25
hausner 2014/07/24 21:05:45 Nit: comply with 2011 Blank Line Conservation Act
srdjan 2014/07/24 21:26:58 Hmm, somehow the latest (and space conserving) CL
26 }
27
28
29
30 sumIt1(Uint32List a, int n) {
31 var sum = 0;
32 for (int i = 0; i < 10; i++) {
33 sum += a[n];
34 }
35 return sum;
36 }
37
38 sumIt2(Int32List a, int n) {
39 var sum = 0;
40 for (int i = 0; i < 10; i++) {
41 sum += a[n];
42 }
43 return sum;
44 }
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