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

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

Issue 23103010: Add issue numbers to language tests status files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // Test if-convertion pass in the optimizing compiler.
6 // VMOptions=--optimization-counter-threshold=10 --no-use-osr
7
8 import "package:expect/expect.dart";
9
10 f1(i) => (i == 0) ? 0 : 1;
11 f2(i) => (i == 0) ? 2 : 3;
12 f3(i) => (i == null) ? 0 : 1;
13 f4(i) => (i == null) ? 2 : 3;
14
15 f5(i) => (i != 0) ? 0 : 1;
16 f6(i) => (i != 0) ? 2 : 3;
17 f7(i) => (i != null) ? 0 : 1;
18 f8(i) => (i != null) ? 2 : 3;
19
20 f9(i) => identical(i, 0) ? 0 : 1;
21 f10(i) => identical(i, 0) ? 2 : 3;
22 f11(i) => identical(i, null) ? 0 : 1;
23 f12(i) => identical(i, null) ? 2 : 3;
24
25 f13(i) => !identical(i, 0) ? 0 : 1;
26 f14(i) => !identical(i, 0) ? 2 : 3;
27 f15(i) => !identical(i, null) ? 0 : 1;
28 f16(i) => !identical(i, null) ? 2 : 3;
29
30 const POWER_OF_2 = 0x1000000000;
31
32 bigPower(i) => (i == 11) ? 0 : POWER_OF_2;
33
34 cse(i) {
35 final a = i == 0 ? 0 : 1;
36 final b = i == 0 ? 2 : 3;
37 return a + b;
38 }
39
40 f17(b) => b ? 0 : 11;
41 f18(b) => b ? 2 : 0;
42
43 main() {
44 for (var i = 0; i < 20; i++) {
45 f1(i);
46 f2(i);
47 f3(i);
48 f4(i);
49 f5(i);
50 f6(i);
51 f7(i);
52 f8(i);
53 f9(i);
54 f10(i);
55 f11(i);
56 f12(i);
57 f13(i);
58 f14(i);
59 f15(i);
60 f16(i);
61 cse(i);
62 bigPower(i);
63 f17(true);
64 f18(true);
65 }
66
67 Expect.equals(0, f1(0));
68 Expect.equals(1, f1(44));
69 Expect.equals(2, f2(0));
70 Expect.equals(3, f2(44));
71 Expect.equals(0, f3(null));
72 Expect.equals(1, f3(44));
73 Expect.equals(2, f4(null));
74 Expect.equals(3, f4(44));
75
76 Expect.equals(1, f5(0));
77 Expect.equals(0, f5(44));
78 Expect.equals(3, f6(0));
79 Expect.equals(2, f6(44));
80 Expect.equals(1, f7(null));
81 Expect.equals(0, f7(44));
82 Expect.equals(3, f8(null));
83 Expect.equals(2, f8(44));
84
85 Expect.equals(0, f9(0));
86 Expect.equals(1, f9(44));
87 Expect.equals(2, f10(0));
88 Expect.equals(3, f10(44));
89 Expect.equals(0, f11(null));
90 Expect.equals(1, f11(44));
91 Expect.equals(2, f12(null));
92 Expect.equals(3, f12(44));
93
94 Expect.equals(1, f13(0));
95 Expect.equals(0, f13(44));
96 Expect.equals(3, f14(0));
97 Expect.equals(2, f14(44));
98 Expect.equals(1, f15(null));
99 Expect.equals(0, f15(44));
100 Expect.equals(3, f16(null));
101 Expect.equals(2, f16(44));
102
103 Expect.equals(0, bigPower(11));
104 Expect.equals(POWER_OF_2, bigPower(12));
105
106 Expect.equals(2, cse(0));
107 Expect.equals(4, cse(1));
108
109 Expect.equals(11, f17(false));
110 Expect.equals(0, f17(true));
111
112 Expect.equals(0, f18(false));
113 Expect.equals(2, f18(true));
114 }
OLDNEW
« no previous file with comments | « tests/language/deopt_hoisted_smi_check_vm_test.dart ('k') | tests/language/issue11087_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698