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

Side by Side Diff: tests/language/compile_time_constant2_test.dart

Issue 10825386: Use JavaScript runtime semantics when constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/canonical_const2_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 const x = 19; 5 const x = 19;
6 const y = 3; 6 const y = 3;
7 const z = -5;
7 const g1 = x + y; 8 const g1 = x + y;
8 const g2 = x * y; 9 const g2 = x * y;
9 const g3 = x / y; 10 const g3 = x / y;
10 const g4 = x ~/ y; 11 const g4 = x ~/ y;
11 const g5 = x << y; 12 const g5 = x << y;
12 const g6 = x >> y; 13 const g6 = x >> y;
13 const g7 = ~x; 14 const g7 = ~z;
14 const g8 = -x; 15 const g8 = -x;
15 const g9 = x < y; 16 const g9 = x < y;
16 const g10 = x <= y; 17 const g10 = x <= y;
17 const g11 = x <= x; 18 const g11 = x <= x;
18 const g12 = x > y; 19 const g12 = x > y;
19 const g13 = x >= y; 20 const g13 = x >= y;
20 const g14 = x >= x; 21 const g14 = x >= x;
21 const g15 = x == y; 22 const g15 = x == y;
22 const g16 = x == x; 23 const g16 = x == x;
23 const g17 = x != y; 24 const g17 = x != y;
24 const g18 = x != x; 25 const g18 = x != x;
25 const g19 = x | y; 26 const g19 = x | y;
26 const g20 = x & y; 27 const g20 = x & y;
27 const g21 = x ^ y; 28 const g21 = x ^ y;
28 const g22 = g1 + g2 + g4 + g5 + g6 + g7 + g8; 29 const g22 = g1 + g2 + g4 + g5 + g6 + g7 + g8;
29 const g23 = x % y; 30 const g23 = x % y;
30 31
31 main() { 32 main() {
32 Expect.equals(22, g1); 33 Expect.equals(22, g1);
33 Expect.equals(57, g2); 34 Expect.equals(57, g2);
34 Expect.equals(6.333333333333333333333333333, g3); 35 Expect.equals(6.333333333333333333333333333, g3);
35 Expect.equals(6, g4); 36 Expect.equals(6, g4);
36 Expect.equals(152, g5); 37 Expect.equals(152, g5);
37 Expect.equals(2, g6); 38 Expect.equals(2, g6);
38 Expect.equals(-20, g7); 39 Expect.equals(4, g7);
39 Expect.equals(-19, g8); 40 Expect.equals(-19, g8);
40 Expect.equals(false, g9); 41 Expect.equals(false, g9);
41 Expect.equals(false, g10); 42 Expect.equals(false, g10);
42 Expect.equals(true, g11); 43 Expect.equals(true, g11);
43 Expect.equals(true, g12); 44 Expect.equals(true, g12);
44 Expect.equals(true, g13); 45 Expect.equals(true, g13);
45 Expect.equals(true, g14); 46 Expect.equals(true, g14);
46 Expect.equals(false, g15); 47 Expect.equals(false, g15);
47 Expect.equals(true, g16); 48 Expect.equals(true, g16);
48 Expect.equals(true, g17); 49 Expect.equals(true, g17);
49 Expect.equals(false, g18); 50 Expect.equals(false, g18);
50 Expect.equals(19, g19); 51 Expect.equals(19, g19);
51 Expect.equals(3, g20); 52 Expect.equals(3, g20);
52 Expect.equals(16, g21); 53 Expect.equals(16, g21);
53 Expect.equals(200, g22); 54 Expect.equals(224, g22);
54 Expect.equals(1, g23); 55 Expect.equals(1, g23);
55 } 56 }
OLDNEW
« no previous file with comments | « tests/language/canonical_const2_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698