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

Side by Side Diff: test/codegen/expect/lib-typed_data-all.js

Issue 1673863002: Infra for running lib tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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
(Empty)
1 dart_library.library('lib/typed_data/byte_data_test', null, /* Imports */[
2 'dart/_runtime',
3 'dart/typed_data',
4 'expect/expect'
5 ], /* Lazy imports */[
6 ], function(exports, dart, typed_data, expect) {
7 'use strict';
8 let dartx = dart.dartx;
9 function main() {
10 testRegress10898();
11 }
12 dart.fn(main);
13 function testRegress10898() {
14 let data = typed_data.ByteData.new(16);
15 expect.Expect.equals(16, data.lengthInBytes);
16 for (let i = 0; i < dart.notNull(data.lengthInBytes); i++) {
17 expect.Expect.equals(0, data.getInt8(i));
18 data.setInt8(i, 42 + i);
19 expect.Expect.equals(42 + i, data.getInt8(i));
20 }
21 let backing = typed_data.ByteData.new(16);
22 let view = typed_data.ByteData.view(backing.buffer);
23 for (let i = 0; i < dart.notNull(view.lengthInBytes); i++) {
24 expect.Expect.equals(0, view.getInt8(i));
25 view.setInt8(i, 87 + i);
26 expect.Expect.equals(87 + i, view.getInt8(i));
27 }
28 view = typed_data.ByteData.view(backing.buffer, 4);
29 expect.Expect.equals(12, view.lengthInBytes);
30 for (let i = 0; i < dart.notNull(view.lengthInBytes); i++) {
31 expect.Expect.equals(87 + i + 4, view.getInt8(i));
32 }
33 view = typed_data.ByteData.view(backing.buffer, 8, 4);
34 expect.Expect.equals(4, view.lengthInBytes);
35 for (let i = 0; i < dart.notNull(view.lengthInBytes); i++) {
36 expect.Expect.equals(87 + i + 8, view.getInt8(i));
37 }
38 }
39 dart.fn(testRegress10898);
40 // Exports:
41 exports.main = main;
42 exports.testRegress10898 = testRegress10898;
43 });
44 dart_library.library('lib/typed_data/constructor_checks_test', null, /* Imports */[
45 'dart/_runtime',
46 'expect/expect',
47 'dart/typed_data',
48 'dart/core'
49 ], /* Lazy imports */[
50 ], function(exports, dart, expect, typed_data, core) {
51 'use strict';
52 let dartx = dart.dartx;
53 function checkLengthConstructors() {
54 function check(creator) {
55 expect.Expect.throws(dart.fn(() => dart.dcall(creator, null), dart.void, [ ]));
56 expect.Expect.throws(dart.fn(() => dart.dcall(creator, 8.5), dart.void, [] ));
57 expect.Expect.throws(dart.fn(() => dart.dcall(creator, '10'), dart.void, [ ]));
58 let a = dart.dcall(creator, 10);
59 expect.Expect.equals(10, dart.dload(a, 'length'));
60 }
61 dart.fn(check);
62 check(dart.fn(a => typed_data.Float32List.new(dart.as(a, core.int)), typed_d ata.Float32List, [dart.dynamic]));
63 check(dart.fn(a => typed_data.Float64List.new(dart.as(a, core.int)), typed_d ata.Float64List, [dart.dynamic]));
64 check(dart.fn(a => typed_data.Int8List.new(dart.as(a, core.int)), typed_data .Int8List, [dart.dynamic]));
65 check(dart.fn(a => typed_data.Int8List.new(dart.as(a, core.int)), typed_data .Int8List, [dart.dynamic]));
66 check(dart.fn(a => typed_data.Int16List.new(dart.as(a, core.int)), typed_dat a.Int16List, [dart.dynamic]));
67 check(dart.fn(a => typed_data.Int32List.new(dart.as(a, core.int)), typed_dat a.Int32List, [dart.dynamic]));
68 check(dart.fn(a => typed_data.Uint8List.new(dart.as(a, core.int)), typed_dat a.Uint8List, [dart.dynamic]));
69 check(dart.fn(a => typed_data.Uint16List.new(dart.as(a, core.int)), typed_da ta.Uint16List, [dart.dynamic]));
70 check(dart.fn(a => typed_data.Uint32List.new(dart.as(a, core.int)), typed_da ta.Uint32List, [dart.dynamic]));
71 }
72 dart.fn(checkLengthConstructors);
73 function checkViewConstructors() {
74 let buffer = typed_data.Int8List.new(256).buffer;
75 function check1(creator) {
76 expect.Expect.throws(dart.fn(() => dart.dcall(creator, 10), dart.void, []) );
77 expect.Expect.throws(dart.fn(() => dart.dcall(creator, null), dart.void, [ ]));
78 let a = dart.dcall(creator, buffer);
79 expect.Expect.equals(buffer, dart.dload(a, 'buffer'));
80 }
81 dart.fn(check1);
82 function check2(creator) {
83 expect.Expect.throws(dart.fn(() => dart.dcall(creator, 10, 0), dart.void, []));
84 expect.Expect.throws(dart.fn(() => dart.dcall(creator, null, 0), dart.void , []));
85 expect.Expect.throws(dart.fn(() => dart.dcall(creator, buffer, null), dart .void, []));
86 expect.Expect.throws(dart.fn(() => dart.dcall(creator, buffer, '8'), dart. void, []));
87 let a = dart.dcall(creator, buffer, 8);
88 expect.Expect.equals(buffer, dart.dload(a, 'buffer'));
89 }
90 dart.fn(check2);
91 check1(dart.fn(a => typed_data.Float32List.view(dart.as(a, typed_data.ByteBu ffer)), typed_data.Float32List, [dart.dynamic]));
92 check1(dart.fn(a => typed_data.Float64List.view(dart.as(a, typed_data.ByteBu ffer)), typed_data.Float64List, [dart.dynamic]));
93 check1(dart.fn(a => typed_data.Int8List.view(dart.as(a, typed_data.ByteBuffe r)), typed_data.Int8List, [dart.dynamic]));
94 check1(dart.fn(a => typed_data.Int8List.view(dart.as(a, typed_data.ByteBuffe r)), typed_data.Int8List, [dart.dynamic]));
95 check1(dart.fn(a => typed_data.Int16List.view(dart.as(a, typed_data.ByteBuff er)), typed_data.Int16List, [dart.dynamic]));
96 check1(dart.fn(a => typed_data.Int32List.view(dart.as(a, typed_data.ByteBuff er)), typed_data.Int32List, [dart.dynamic]));
97 check1(dart.fn(a => typed_data.Uint8List.view(dart.as(a, typed_data.ByteBuff er)), typed_data.Uint8List, [dart.dynamic]));
98 check1(dart.fn(a => typed_data.Uint16List.view(dart.as(a, typed_data.ByteBuf fer)), typed_data.Uint16List, [dart.dynamic]));
99 check1(dart.fn(a => typed_data.Uint32List.view(dart.as(a, typed_data.ByteBuf fer)), typed_data.Uint32List, [dart.dynamic]));
100 check2(dart.fn((a, b) => typed_data.Float32List.view(dart.as(a, typed_data.B yteBuffer), dart.as(b, core.int)), typed_data.Float32List, [dart.dynamic, dart.d ynamic]));
101 check2(dart.fn((a, b) => typed_data.Float64List.view(dart.as(a, typed_data.B yteBuffer), dart.as(b, core.int)), typed_data.Float64List, [dart.dynamic, dart.d ynamic]));
102 check2(dart.fn((a, b) => typed_data.Int8List.view(dart.as(a, typed_data.Byte Buffer), dart.as(b, core.int)), typed_data.Int8List, [dart.dynamic, dart.dynamic ]));
103 check2(dart.fn((a, b) => typed_data.Int8List.view(dart.as(a, typed_data.Byte Buffer), dart.as(b, core.int)), typed_data.Int8List, [dart.dynamic, dart.dynamic ]));
104 check2(dart.fn((a, b) => typed_data.Int16List.view(dart.as(a, typed_data.Byt eBuffer), dart.as(b, core.int)), typed_data.Int16List, [dart.dynamic, dart.dynam ic]));
105 check2(dart.fn((a, b) => typed_data.Int32List.view(dart.as(a, typed_data.Byt eBuffer), dart.as(b, core.int)), typed_data.Int32List, [dart.dynamic, dart.dynam ic]));
106 check2(dart.fn((a, b) => typed_data.Uint8List.view(dart.as(a, typed_data.Byt eBuffer), dart.as(b, core.int)), typed_data.Uint8List, [dart.dynamic, dart.dynam ic]));
107 check2(dart.fn((a, b) => typed_data.Uint16List.view(dart.as(a, typed_data.By teBuffer), dart.as(b, core.int)), typed_data.Uint16List, [dart.dynamic, dart.dyn amic]));
108 check2(dart.fn((a, b) => typed_data.Uint32List.view(dart.as(a, typed_data.By teBuffer), dart.as(b, core.int)), typed_data.Uint32List, [dart.dynamic, dart.dyn amic]));
109 }
110 dart.fn(checkViewConstructors);
111 function main() {
112 checkLengthConstructors();
113 checkViewConstructors();
114 }
115 dart.fn(main);
116 // Exports:
117 exports.checkLengthConstructors = checkLengthConstructors;
118 exports.checkViewConstructors = checkViewConstructors;
119 exports.main = main;
120 });
121 dart_library.library('lib/typed_data/endianness_test', null, /* Imports */[
122 'dart/_runtime',
123 'dart/typed_data',
124 'expect/expect'
125 ], /* Lazy imports */[
126 ], function(exports, dart, typed_data, expect) {
127 'use strict';
128 let dartx = dart.dartx;
129 function main() {
130 swapTest();
131 swapTestVar(typed_data.Endianness.LITTLE_ENDIAN, typed_data.Endianness.BIG_E NDIAN);
132 swapTestVar(typed_data.Endianness.BIG_ENDIAN, typed_data.Endianness.LITTLE_E NDIAN);
133 }
134 dart.fn(main);
135 function swapTest() {
136 let data = typed_data.ByteData.new(16);
137 expect.Expect.equals(16, data.lengthInBytes);
138 for (let i = 0; i < 4; i++) {
139 data.setInt32(i * 4, i);
140 }
141 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 4) {
142 let e = data.getInt32(i, typed_data.Endianness.BIG_ENDIAN);
143 data.setInt32(i, e, typed_data.Endianness.LITTLE_ENDIAN);
144 }
145 expect.Expect.equals(33554432, data.getInt32(8));
146 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 2) {
147 let e = data.getInt16(i, typed_data.Endianness.BIG_ENDIAN);
148 data.setInt16(i, e, typed_data.Endianness.LITTLE_ENDIAN);
149 }
150 expect.Expect.equals(131072, data.getInt32(8));
151 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 4) {
152 let e = data.getUint32(i, typed_data.Endianness.LITTLE_ENDIAN);
153 data.setUint32(i, e, typed_data.Endianness.BIG_ENDIAN);
154 }
155 expect.Expect.equals(512, data.getInt32(8));
156 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 2) {
157 let e = data.getUint16(i, typed_data.Endianness.LITTLE_ENDIAN);
158 data.setUint16(i, e, typed_data.Endianness.BIG_ENDIAN);
159 }
160 expect.Expect.equals(2, data.getInt32(8));
161 }
162 dart.fn(swapTest);
163 function swapTestVar(read, write) {
164 let data = typed_data.ByteData.new(16);
165 expect.Expect.equals(16, data.lengthInBytes);
166 for (let i = 0; i < 4; i++) {
167 data.setInt32(i * 4, i);
168 }
169 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 4) {
170 let e = data.getInt32(i, dart.as(read, typed_data.Endianness));
171 data.setInt32(i, e, dart.as(write, typed_data.Endianness));
172 }
173 expect.Expect.equals(33554432, data.getInt32(8));
174 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 2) {
175 let e = data.getInt16(i, dart.as(read, typed_data.Endianness));
176 data.setInt16(i, e, dart.as(write, typed_data.Endianness));
177 }
178 expect.Expect.equals(131072, data.getInt32(8));
179 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 4) {
180 let e = data.getUint32(i, dart.as(read, typed_data.Endianness));
181 data.setUint32(i, e, dart.as(write, typed_data.Endianness));
182 }
183 expect.Expect.equals(512, data.getInt32(8));
184 for (let i = 0; i < dart.notNull(data.lengthInBytes); i = i + 2) {
185 let e = data.getUint16(i, dart.as(read, typed_data.Endianness));
186 data.setUint16(i, e, dart.as(write, typed_data.Endianness));
187 }
188 expect.Expect.equals(2, data.getInt32(8));
189 }
190 dart.fn(swapTestVar);
191 // Exports:
192 exports.main = main;
193 exports.swapTest = swapTest;
194 exports.swapTestVar = swapTestVar;
195 });
196 dart_library.library('lib/typed_data/float32x4_clamp_test', null, /* Imports */[
197 'dart/_runtime',
198 'dart/typed_data',
199 'expect/expect'
200 ], /* Lazy imports */[
201 ], function(exports, dart, typed_data, expect) {
202 'use strict';
203 let dartx = dart.dartx;
204 function testClampLowerGreaterThanUpper() {
205 let l = typed_data.Float32x4.new(1.0, 1.0, 1.0, 1.0);
206 let u = typed_data.Float32x4.new(-1.0, -1.0, -1.0, -1.0);
207 let z = typed_data.Float32x4.zero();
208 let a = z.clamp(l, u);
209 expect.Expect.equals(a.x, 1.0);
210 expect.Expect.equals(a.y, 1.0);
211 expect.Expect.equals(a.z, 1.0);
212 expect.Expect.equals(a.w, 1.0);
213 }
214 dart.fn(testClampLowerGreaterThanUpper, dart.void, []);
215 function testClamp() {
216 let l = typed_data.Float32x4.new(-1.0, -1.0, -1.0, -1.0);
217 let u = typed_data.Float32x4.new(1.0, 1.0, 1.0, 1.0);
218 let z = typed_data.Float32x4.zero();
219 let a = z.clamp(l, u);
220 expect.Expect.equals(a.x, 0.0);
221 expect.Expect.equals(a.y, 0.0);
222 expect.Expect.equals(a.z, 0.0);
223 expect.Expect.equals(a.w, 0.0);
224 }
225 dart.fn(testClamp, dart.void, []);
226 function main() {
227 for (let i = 0; i < 2000; i++) {
228 testClampLowerGreaterThanUpper();
229 testClamp();
230 }
231 }
232 dart.fn(main);
233 // Exports:
234 exports.testClampLowerGreaterThanUpper = testClampLowerGreaterThanUpper;
235 exports.testClamp = testClamp;
236 exports.main = main;
237 });
238 dart_library.library('lib/typed_data/float32x4_cross_test', null, /* Imports */[
239 'dart/_runtime',
240 'dart/typed_data',
241 'expect/expect'
242 ], /* Lazy imports */[
243 ], function(exports, dart, typed_data, expect) {
244 'use strict';
245 let dartx = dart.dartx;
246 function cross(a, b) {
247 let t0 = a.shuffle(typed_data.Float32x4.YZXW);
248 let t1 = b.shuffle(typed_data.Float32x4.ZXYW);
249 let l = t0['*'](t1);
250 t0 = a.shuffle(typed_data.Float32x4.ZXYW);
251 t1 = b.shuffle(typed_data.Float32x4.YZXW);
252 let r = t0['*'](t1);
253 return l['-'](r);
254 }
255 dart.fn(cross, typed_data.Float32x4, [typed_data.Float32x4, typed_data.Float32 x4]);
256 function testCross(a, b, r) {
257 let x = cross(a, b);
258 expect.Expect.equals(r.x, x.x);
259 expect.Expect.equals(r.y, x.y);
260 expect.Expect.equals(r.z, x.z);
261 expect.Expect.equals(r.w, x.w);
262 }
263 dart.fn(testCross, dart.void, [typed_data.Float32x4, typed_data.Float32x4, typ ed_data.Float32x4]);
264 function main() {
265 let x = typed_data.Float32x4.new(1.0, 0.0, 0.0, 0.0);
266 let y = typed_data.Float32x4.new(0.0, 1.0, 0.0, 0.0);
267 let z = typed_data.Float32x4.new(0.0, 0.0, 1.0, 0.0);
268 let zero = typed_data.Float32x4.zero();
269 for (let i = 0; i < 20; i++) {
270 testCross(x, y, z);
271 testCross(z, x, y);
272 testCross(y, z, x);
273 testCross(z, y, x['unary-']());
274 testCross(x, z, y['unary-']());
275 testCross(y, x, z['unary-']());
276 testCross(x, x, zero);
277 testCross(y, y, zero);
278 testCross(z, z, zero);
279 testCross(x, y, cross(y['unary-'](), x));
280 testCross(x, y['+'](z), cross(x, y)['+'](cross(x, z)));
281 }
282 }
283 dart.fn(main);
284 // Exports:
285 exports.cross = cross;
286 exports.testCross = testCross;
287 exports.main = main;
288 });
289 dart_library.library('lib/typed_data/float32x4_list_test', null, /* Imports */[
290 'dart/_runtime',
291 'expect/expect',
292 'dart/core',
293 'dart/typed_data'
294 ], /* Lazy imports */[
295 ], function(exports, dart, expect, core, typed_data) {
296 'use strict';
297 let dartx = dart.dartx;
298 function testLoadStore(array) {
299 expect.Expect.equals(8, dart.dload(array, 'length'));
300 expect.Expect.isTrue(dart.is(array, core.List$(typed_data.Float32x4)));
301 dart.dsetindex(array, 0, typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0));
302 expect.Expect.equals(1.0, dart.dload(dart.dindex(array, 0), 'x'));
303 expect.Expect.equals(2.0, dart.dload(dart.dindex(array, 0), 'y'));
304 expect.Expect.equals(3.0, dart.dload(dart.dindex(array, 0), 'z'));
305 expect.Expect.equals(4.0, dart.dload(dart.dindex(array, 0), 'w'));
306 dart.dsetindex(array, 1, dart.dindex(array, 0));
307 dart.dsetindex(array, 0, dart.dsend(dart.dindex(array, 0), 'withX', 9.0));
308 expect.Expect.equals(9.0, dart.dload(dart.dindex(array, 0), 'x'));
309 expect.Expect.equals(2.0, dart.dload(dart.dindex(array, 0), 'y'));
310 expect.Expect.equals(3.0, dart.dload(dart.dindex(array, 0), 'z'));
311 expect.Expect.equals(4.0, dart.dload(dart.dindex(array, 0), 'w'));
312 expect.Expect.equals(1.0, dart.dload(dart.dindex(array, 1), 'x'));
313 expect.Expect.equals(2.0, dart.dload(dart.dindex(array, 1), 'y'));
314 expect.Expect.equals(3.0, dart.dload(dart.dindex(array, 1), 'z'));
315 expect.Expect.equals(4.0, dart.dload(dart.dindex(array, 1), 'w'));
316 }
317 dart.fn(testLoadStore);
318 function testLoadStoreDeopt(array, index, value) {
319 dart.dsetindex(array, index, value);
320 expect.Expect.equals(dart.dload(value, 'x'), dart.dload(dart.dindex(array, i ndex), 'x'));
321 expect.Expect.equals(dart.dload(value, 'y'), dart.dload(dart.dindex(array, i ndex), 'y'));
322 expect.Expect.equals(dart.dload(value, 'z'), dart.dload(dart.dindex(array, i ndex), 'z'));
323 expect.Expect.equals(dart.dload(value, 'w'), dart.dload(dart.dindex(array, i ndex), 'w'));
324 }
325 dart.fn(testLoadStoreDeopt);
326 function testLoadStoreDeoptDriver() {
327 let list = typed_data.Float32x4List.new(4);
328 let value = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
329 for (let i = 0; i < 20; i++) {
330 testLoadStoreDeopt(list, 0, value);
331 }
332 try {
333 testLoadStoreDeopt(list, 5, value);
334 } catch (_) {
335 }
336
337 for (let i = 0; i < 20; i++) {
338 testLoadStoreDeopt(list, 0, value);
339 }
340 try {
341 testLoadStoreDeopt(null, 0, value);
342 } catch (_) {
343 }
344
345 for (let i = 0; i < 20; i++) {
346 testLoadStoreDeopt(list, 0, value);
347 }
348 try {
349 testLoadStoreDeopt(list, 0, null);
350 } catch (_) {
351 }
352
353 for (let i = 0; i < 20; i++) {
354 testLoadStoreDeopt(list, 0, value);
355 }
356 try {
357 testLoadStoreDeopt(list, 3.14159, value);
358 } catch (_) {
359 }
360
361 for (let i = 0; i < 20; i++) {
362 testLoadStoreDeopt(list, 0, value);
363 }
364 try {
365 testLoadStoreDeopt(list, 0, (4)[dartx.toDouble]());
366 } catch (_) {
367 }
368
369 for (let i = 0; i < 20; i++) {
370 testLoadStoreDeopt(list, 0, value);
371 }
372 try {
373 testLoadStoreDeopt([typed_data.Float32x4.new(2.0, 3.0, 4.0, 5.0)], 0, valu e);
374 } catch (_) {
375 }
376
377 for (let i = 0; i < 20; i++) {
378 testLoadStoreDeopt(list, 0, value);
379 }
380 }
381 dart.fn(testLoadStoreDeoptDriver);
382 function testListZero() {
383 let list = typed_data.Float32x4List.new(1);
384 expect.Expect.equals(0.0, list.get(0).x);
385 expect.Expect.equals(0.0, list.get(0).y);
386 expect.Expect.equals(0.0, list.get(0).z);
387 expect.Expect.equals(0.0, list.get(0).w);
388 }
389 dart.fn(testListZero);
390 function testView(array) {
391 expect.Expect.equals(8, dart.dload(array, 'length'));
392 expect.Expect.isTrue(dart.is(array, core.List$(typed_data.Float32x4)));
393 expect.Expect.equals(0.0, dart.dload(dart.dindex(array, 0), 'x'));
394 expect.Expect.equals(1.0, dart.dload(dart.dindex(array, 0), 'y'));
395 expect.Expect.equals(2.0, dart.dload(dart.dindex(array, 0), 'z'));
396 expect.Expect.equals(3.0, dart.dload(dart.dindex(array, 0), 'w'));
397 expect.Expect.equals(4.0, dart.dload(dart.dindex(array, 1), 'x'));
398 expect.Expect.equals(5.0, dart.dload(dart.dindex(array, 1), 'y'));
399 expect.Expect.equals(6.0, dart.dload(dart.dindex(array, 1), 'z'));
400 expect.Expect.equals(7.0, dart.dload(dart.dindex(array, 1), 'w'));
401 }
402 dart.fn(testView);
403 function testSublist(array) {
404 expect.Expect.equals(8, dart.dload(array, 'length'));
405 expect.Expect.isTrue(dart.is(array, typed_data.Float32x4List));
406 let a = dart.dsend(array, 'sublist', 0, 1);
407 expect.Expect.equals(1, dart.dload(a, 'length'));
408 expect.Expect.equals(0.0, dart.dload(dart.dindex(a, 0), 'x'));
409 expect.Expect.equals(1.0, dart.dload(dart.dindex(a, 0), 'y'));
410 expect.Expect.equals(2.0, dart.dload(dart.dindex(a, 0), 'z'));
411 expect.Expect.equals(3.0, dart.dload(dart.dindex(a, 0), 'w'));
412 a = dart.dsend(array, 'sublist', 1, 2);
413 expect.Expect.equals(4.0, dart.dload(dart.dindex(a, 0), 'x'));
414 expect.Expect.equals(5.0, dart.dload(dart.dindex(a, 0), 'y'));
415 expect.Expect.equals(6.0, dart.dload(dart.dindex(a, 0), 'z'));
416 expect.Expect.equals(7.0, dart.dload(dart.dindex(a, 0), 'w'));
417 a = dart.dsend(array, 'sublist', 0);
418 expect.Expect.equals(dart.dload(a, 'length'), dart.dload(array, 'length'));
419 for (let i = 0; i < dart.notNull(dart.as(dart.dload(array, 'length'), core.n um)); i++) {
420 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'x'), dart.dload(da rt.dindex(a, i), 'x'));
421 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'y'), dart.dload(da rt.dindex(a, i), 'y'));
422 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'z'), dart.dload(da rt.dindex(a, i), 'z'));
423 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'w'), dart.dload(da rt.dindex(a, i), 'w'));
424 }
425 }
426 dart.fn(testSublist);
427 function testSpecialValues(array) {
428 function checkEquals(expected, actual) {
429 if (dart.notNull(dart.as(dart.dload(expected, 'isNaN'), core.bool))) {
430 expect.Expect.isTrue(dart.dload(actual, 'isNaN'));
431 } else if (dart.equals(expected, 0.0) && dart.notNull(dart.as(dart.dload(e xpected, 'isNegative'), core.bool))) {
432 expect.Expect.isTrue(dart.equals(actual, 0.0) && dart.notNull(dart.as(da rt.dload(actual, 'isNegative'), core.bool)));
433 } else {
434 expect.Expect.equals(expected, actual);
435 }
436 }
437 dart.fn(checkEquals, dart.void, [dart.dynamic, dart.dynamic]);
438 let pairs = [[0.0, 0.0], [5e-324, 0.0], [2.225073858507201e-308, 0.0], [2.22 50738585072014e-308, 0.0], [0.9999999999999999, 1.0], [1.0, 1.0], [1.00000000000 00002, 1.0], [4294967295.0, 4294967296.0], [4294967296.0, 4294967296.0], [450359 9627370495.5, 4503599627370496.0], [9007199254740992.0, 9007199254740992.0], [1. 7976931348623157e+308, core.double.INFINITY], [0.49999999999999994, 0.5], [45035 99627370497.0, 4503599627370496.0], [9007199254740991.0, 9007199254740992.0], [c ore.double.INFINITY, core.double.INFINITY], [core.double.NAN, core.double.NAN]];
439 let conserved = [1.401298464324817e-45, 1.1754942106924411e-38, 1.1754943508 222875e-38, 0.9999999403953552, 1.0000001192092896, 8388607.5, 8388608.0, 3.4028 234663852886e+38, 8388609.0, 16777215.0];
440 let minusPairs = pairs[dartx.map](dart.fn(pair => {
441 return [dart.dsend(dart.dindex(pair, 0), 'unary-'), dart.dsend(dart.dindex (pair, 1), 'unary-')];
442 }));
443 let conservedPairs = conserved[dartx.map](dart.fn(value => [value, value], c ore.List, [dart.dynamic]));
444 let allTests = [pairs, minusPairs, conservedPairs][dartx.expand](dart.fn(x = > dart.as(x, core.Iterable), core.Iterable, [dart.dynamic]));
445 for (let pair of allTests) {
446 let input = dart.dindex(pair, 0);
447 let expected = dart.dindex(pair, 1);
448 let f = null;
449 f = typed_data.Float32x4.new(dart.as(input, core.double), 2.0, 3.0, 4.0);
450 dart.dsetindex(array, 0, f);
451 f = dart.dindex(array, 0);
452 checkEquals(expected, dart.dload(f, 'x'));
453 expect.Expect.equals(2.0, dart.dload(f, 'y'));
454 expect.Expect.equals(3.0, dart.dload(f, 'z'));
455 expect.Expect.equals(4.0, dart.dload(f, 'w'));
456 f = typed_data.Float32x4.new(1.0, dart.as(input, core.double), 3.0, 4.0);
457 dart.dsetindex(array, 1, f);
458 f = dart.dindex(array, 1);
459 expect.Expect.equals(1.0, dart.dload(f, 'x'));
460 checkEquals(expected, dart.dload(f, 'y'));
461 expect.Expect.equals(3.0, dart.dload(f, 'z'));
462 expect.Expect.equals(4.0, dart.dload(f, 'w'));
463 f = typed_data.Float32x4.new(1.0, 2.0, dart.as(input, core.double), 4.0);
464 dart.dsetindex(array, 2, f);
465 f = dart.dindex(array, 2);
466 expect.Expect.equals(1.0, dart.dload(f, 'x'));
467 expect.Expect.equals(2.0, dart.dload(f, 'y'));
468 checkEquals(expected, dart.dload(f, 'z'));
469 expect.Expect.equals(4.0, dart.dload(f, 'w'));
470 f = typed_data.Float32x4.new(1.0, 2.0, 3.0, dart.as(input, core.double));
471 dart.dsetindex(array, 3, f);
472 f = dart.dindex(array, 3);
473 expect.Expect.equals(1.0, dart.dload(f, 'x'));
474 expect.Expect.equals(2.0, dart.dload(f, 'y'));
475 expect.Expect.equals(3.0, dart.dload(f, 'z'));
476 checkEquals(expected, dart.dload(f, 'w'));
477 }
478 }
479 dart.fn(testSpecialValues, dart.void, [dart.dynamic]);
480 function main() {
481 let list = null;
482 list = typed_data.Float32x4List.new(8);
483 for (let i = 0; i < 20; i++) {
484 testLoadStore(list);
485 }
486 let floatList = typed_data.Float32List.new(32);
487 for (let i = 0; i < dart.notNull(floatList.length); i++) {
488 floatList.set(i, i[dartx.toDouble]());
489 }
490 list = typed_data.Float32x4List.view(floatList.buffer);
491 for (let i = 0; i < 20; i++) {
492 testView(list);
493 }
494 for (let i = 0; i < 20; i++) {
495 testSublist(list);
496 }
497 for (let i = 0; i < 20; i++) {
498 testLoadStore(list);
499 }
500 for (let i = 0; i < 20; i++) {
501 testListZero();
502 }
503 for (let i = 0; i < 20; i++) {
504 testSpecialValues(list);
505 }
506 testLoadStoreDeoptDriver();
507 }
508 dart.fn(main);
509 // Exports:
510 exports.testLoadStore = testLoadStore;
511 exports.testLoadStoreDeopt = testLoadStoreDeopt;
512 exports.testLoadStoreDeoptDriver = testLoadStoreDeoptDriver;
513 exports.testListZero = testListZero;
514 exports.testView = testView;
515 exports.testSublist = testSublist;
516 exports.testSpecialValues = testSpecialValues;
517 exports.main = main;
518 });
519 dart_library.library('lib/typed_data/float32x4_shuffle_test', null, /* Imports * /[
520 'dart/_runtime',
521 'dart/typed_data',
522 'expect/expect',
523 'dart/core'
524 ], /* Lazy imports */[
525 ], function(exports, dart, typed_data, expect, core) {
526 'use strict';
527 let dartx = dart.dartx;
528 function testShuffle00() {
529 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
530 let c = null;
531 c = m.shuffle(typed_data.Float32x4.XXXX);
532 expect.Expect.equals(1.0, dart.dload(c, 'x'));
533 expect.Expect.equals(1.0, dart.dload(c, 'y'));
534 expect.Expect.equals(1.0, dart.dload(c, 'z'));
535 expect.Expect.equals(1.0, dart.dload(c, 'w'));
536 c = m.shuffle(typed_data.Float32x4.XXXY);
537 expect.Expect.equals(1.0, dart.dload(c, 'x'));
538 expect.Expect.equals(1.0, dart.dload(c, 'y'));
539 expect.Expect.equals(1.0, dart.dload(c, 'z'));
540 expect.Expect.equals(2.0, dart.dload(c, 'w'));
541 c = m.shuffle(typed_data.Float32x4.XXXZ);
542 expect.Expect.equals(1.0, dart.dload(c, 'x'));
543 expect.Expect.equals(1.0, dart.dload(c, 'y'));
544 expect.Expect.equals(1.0, dart.dload(c, 'z'));
545 expect.Expect.equals(3.0, dart.dload(c, 'w'));
546 c = m.shuffle(typed_data.Float32x4.XXXW);
547 expect.Expect.equals(1.0, dart.dload(c, 'x'));
548 expect.Expect.equals(1.0, dart.dload(c, 'y'));
549 expect.Expect.equals(1.0, dart.dload(c, 'z'));
550 expect.Expect.equals(4.0, dart.dload(c, 'w'));
551 c = m.shuffle(typed_data.Float32x4.XXYX);
552 expect.Expect.equals(1.0, dart.dload(c, 'x'));
553 expect.Expect.equals(1.0, dart.dload(c, 'y'));
554 expect.Expect.equals(2.0, dart.dload(c, 'z'));
555 expect.Expect.equals(1.0, dart.dload(c, 'w'));
556 c = m.shuffle(typed_data.Float32x4.XXYY);
557 expect.Expect.equals(1.0, dart.dload(c, 'x'));
558 expect.Expect.equals(1.0, dart.dload(c, 'y'));
559 expect.Expect.equals(2.0, dart.dload(c, 'z'));
560 expect.Expect.equals(2.0, dart.dload(c, 'w'));
561 c = m.shuffle(typed_data.Float32x4.XXYZ);
562 expect.Expect.equals(1.0, dart.dload(c, 'x'));
563 expect.Expect.equals(1.0, dart.dload(c, 'y'));
564 expect.Expect.equals(2.0, dart.dload(c, 'z'));
565 expect.Expect.equals(3.0, dart.dload(c, 'w'));
566 c = m.shuffle(typed_data.Float32x4.XXYW);
567 expect.Expect.equals(1.0, dart.dload(c, 'x'));
568 expect.Expect.equals(1.0, dart.dload(c, 'y'));
569 expect.Expect.equals(2.0, dart.dload(c, 'z'));
570 expect.Expect.equals(4.0, dart.dload(c, 'w'));
571 c = m.shuffle(typed_data.Float32x4.XXZX);
572 expect.Expect.equals(1.0, dart.dload(c, 'x'));
573 expect.Expect.equals(1.0, dart.dload(c, 'y'));
574 expect.Expect.equals(3.0, dart.dload(c, 'z'));
575 expect.Expect.equals(1.0, dart.dload(c, 'w'));
576 c = m.shuffle(typed_data.Float32x4.XXZY);
577 expect.Expect.equals(1.0, dart.dload(c, 'x'));
578 expect.Expect.equals(1.0, dart.dload(c, 'y'));
579 expect.Expect.equals(3.0, dart.dload(c, 'z'));
580 expect.Expect.equals(2.0, dart.dload(c, 'w'));
581 c = m.shuffle(typed_data.Float32x4.XXZZ);
582 expect.Expect.equals(1.0, dart.dload(c, 'x'));
583 expect.Expect.equals(1.0, dart.dload(c, 'y'));
584 expect.Expect.equals(3.0, dart.dload(c, 'z'));
585 expect.Expect.equals(3.0, dart.dload(c, 'w'));
586 c = m.shuffle(typed_data.Float32x4.XXZW);
587 expect.Expect.equals(1.0, dart.dload(c, 'x'));
588 expect.Expect.equals(1.0, dart.dload(c, 'y'));
589 expect.Expect.equals(3.0, dart.dload(c, 'z'));
590 expect.Expect.equals(4.0, dart.dload(c, 'w'));
591 c = m.shuffle(typed_data.Float32x4.XXWX);
592 expect.Expect.equals(1.0, dart.dload(c, 'x'));
593 expect.Expect.equals(1.0, dart.dload(c, 'y'));
594 expect.Expect.equals(4.0, dart.dload(c, 'z'));
595 expect.Expect.equals(1.0, dart.dload(c, 'w'));
596 c = m.shuffle(typed_data.Float32x4.XXWY);
597 expect.Expect.equals(1.0, dart.dload(c, 'x'));
598 expect.Expect.equals(1.0, dart.dload(c, 'y'));
599 expect.Expect.equals(4.0, dart.dload(c, 'z'));
600 expect.Expect.equals(2.0, dart.dload(c, 'w'));
601 c = m.shuffle(typed_data.Float32x4.XXWZ);
602 expect.Expect.equals(1.0, dart.dload(c, 'x'));
603 expect.Expect.equals(1.0, dart.dload(c, 'y'));
604 expect.Expect.equals(4.0, dart.dload(c, 'z'));
605 expect.Expect.equals(3.0, dart.dload(c, 'w'));
606 c = m.shuffle(typed_data.Float32x4.XXWW);
607 expect.Expect.equals(1.0, dart.dload(c, 'x'));
608 expect.Expect.equals(1.0, dart.dload(c, 'y'));
609 expect.Expect.equals(4.0, dart.dload(c, 'z'));
610 expect.Expect.equals(4.0, dart.dload(c, 'w'));
611 }
612 dart.fn(testShuffle00, dart.void, []);
613 function testShuffle01() {
614 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
615 let c = null;
616 c = m.shuffle(typed_data.Float32x4.XYXX);
617 expect.Expect.equals(1.0, dart.dload(c, 'x'));
618 expect.Expect.equals(2.0, dart.dload(c, 'y'));
619 expect.Expect.equals(1.0, dart.dload(c, 'z'));
620 expect.Expect.equals(1.0, dart.dload(c, 'w'));
621 c = m.shuffle(typed_data.Float32x4.XYXY);
622 expect.Expect.equals(1.0, dart.dload(c, 'x'));
623 expect.Expect.equals(2.0, dart.dload(c, 'y'));
624 expect.Expect.equals(1.0, dart.dload(c, 'z'));
625 expect.Expect.equals(2.0, dart.dload(c, 'w'));
626 c = m.shuffle(typed_data.Float32x4.XYXZ);
627 expect.Expect.equals(1.0, dart.dload(c, 'x'));
628 expect.Expect.equals(2.0, dart.dload(c, 'y'));
629 expect.Expect.equals(1.0, dart.dload(c, 'z'));
630 expect.Expect.equals(3.0, dart.dload(c, 'w'));
631 c = m.shuffle(typed_data.Float32x4.XYXW);
632 expect.Expect.equals(1.0, dart.dload(c, 'x'));
633 expect.Expect.equals(2.0, dart.dload(c, 'y'));
634 expect.Expect.equals(1.0, dart.dload(c, 'z'));
635 expect.Expect.equals(4.0, dart.dload(c, 'w'));
636 c = m.shuffle(typed_data.Float32x4.XYYX);
637 expect.Expect.equals(1.0, dart.dload(c, 'x'));
638 expect.Expect.equals(2.0, dart.dload(c, 'y'));
639 expect.Expect.equals(2.0, dart.dload(c, 'z'));
640 expect.Expect.equals(1.0, dart.dload(c, 'w'));
641 c = m.shuffle(typed_data.Float32x4.XYYY);
642 expect.Expect.equals(1.0, dart.dload(c, 'x'));
643 expect.Expect.equals(2.0, dart.dload(c, 'y'));
644 expect.Expect.equals(2.0, dart.dload(c, 'z'));
645 expect.Expect.equals(2.0, dart.dload(c, 'w'));
646 c = m.shuffle(typed_data.Float32x4.XYYZ);
647 expect.Expect.equals(1.0, dart.dload(c, 'x'));
648 expect.Expect.equals(2.0, dart.dload(c, 'y'));
649 expect.Expect.equals(2.0, dart.dload(c, 'z'));
650 expect.Expect.equals(3.0, dart.dload(c, 'w'));
651 c = m.shuffle(typed_data.Float32x4.XYYW);
652 expect.Expect.equals(1.0, dart.dload(c, 'x'));
653 expect.Expect.equals(2.0, dart.dload(c, 'y'));
654 expect.Expect.equals(2.0, dart.dload(c, 'z'));
655 expect.Expect.equals(4.0, dart.dload(c, 'w'));
656 c = m.shuffle(typed_data.Float32x4.XYZX);
657 expect.Expect.equals(1.0, dart.dload(c, 'x'));
658 expect.Expect.equals(2.0, dart.dload(c, 'y'));
659 expect.Expect.equals(3.0, dart.dload(c, 'z'));
660 expect.Expect.equals(1.0, dart.dload(c, 'w'));
661 c = m.shuffle(typed_data.Float32x4.XYZY);
662 expect.Expect.equals(1.0, dart.dload(c, 'x'));
663 expect.Expect.equals(2.0, dart.dload(c, 'y'));
664 expect.Expect.equals(3.0, dart.dload(c, 'z'));
665 expect.Expect.equals(2.0, dart.dload(c, 'w'));
666 c = m.shuffle(typed_data.Float32x4.XYZZ);
667 expect.Expect.equals(1.0, dart.dload(c, 'x'));
668 expect.Expect.equals(2.0, dart.dload(c, 'y'));
669 expect.Expect.equals(3.0, dart.dload(c, 'z'));
670 expect.Expect.equals(3.0, dart.dload(c, 'w'));
671 c = m.shuffle(typed_data.Float32x4.XYZW);
672 expect.Expect.equals(1.0, dart.dload(c, 'x'));
673 expect.Expect.equals(2.0, dart.dload(c, 'y'));
674 expect.Expect.equals(3.0, dart.dload(c, 'z'));
675 expect.Expect.equals(4.0, dart.dload(c, 'w'));
676 c = m.shuffle(typed_data.Float32x4.XYWX);
677 expect.Expect.equals(1.0, dart.dload(c, 'x'));
678 expect.Expect.equals(2.0, dart.dload(c, 'y'));
679 expect.Expect.equals(4.0, dart.dload(c, 'z'));
680 expect.Expect.equals(1.0, dart.dload(c, 'w'));
681 c = m.shuffle(typed_data.Float32x4.XYWY);
682 expect.Expect.equals(1.0, dart.dload(c, 'x'));
683 expect.Expect.equals(2.0, dart.dload(c, 'y'));
684 expect.Expect.equals(4.0, dart.dload(c, 'z'));
685 expect.Expect.equals(2.0, dart.dload(c, 'w'));
686 c = m.shuffle(typed_data.Float32x4.XYWZ);
687 expect.Expect.equals(1.0, dart.dload(c, 'x'));
688 expect.Expect.equals(2.0, dart.dload(c, 'y'));
689 expect.Expect.equals(4.0, dart.dload(c, 'z'));
690 expect.Expect.equals(3.0, dart.dload(c, 'w'));
691 c = m.shuffle(typed_data.Float32x4.XYWW);
692 expect.Expect.equals(1.0, dart.dload(c, 'x'));
693 expect.Expect.equals(2.0, dart.dload(c, 'y'));
694 expect.Expect.equals(4.0, dart.dload(c, 'z'));
695 expect.Expect.equals(4.0, dart.dload(c, 'w'));
696 }
697 dart.fn(testShuffle01, dart.void, []);
698 function testShuffle02() {
699 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
700 let c = null;
701 c = m.shuffle(typed_data.Float32x4.XZXX);
702 expect.Expect.equals(1.0, dart.dload(c, 'x'));
703 expect.Expect.equals(3.0, dart.dload(c, 'y'));
704 expect.Expect.equals(1.0, dart.dload(c, 'z'));
705 expect.Expect.equals(1.0, dart.dload(c, 'w'));
706 c = m.shuffle(typed_data.Float32x4.XZXY);
707 expect.Expect.equals(1.0, dart.dload(c, 'x'));
708 expect.Expect.equals(3.0, dart.dload(c, 'y'));
709 expect.Expect.equals(1.0, dart.dload(c, 'z'));
710 expect.Expect.equals(2.0, dart.dload(c, 'w'));
711 c = m.shuffle(typed_data.Float32x4.XZXZ);
712 expect.Expect.equals(1.0, dart.dload(c, 'x'));
713 expect.Expect.equals(3.0, dart.dload(c, 'y'));
714 expect.Expect.equals(1.0, dart.dload(c, 'z'));
715 expect.Expect.equals(3.0, dart.dload(c, 'w'));
716 c = m.shuffle(typed_data.Float32x4.XZXW);
717 expect.Expect.equals(1.0, dart.dload(c, 'x'));
718 expect.Expect.equals(3.0, dart.dload(c, 'y'));
719 expect.Expect.equals(1.0, dart.dload(c, 'z'));
720 expect.Expect.equals(4.0, dart.dload(c, 'w'));
721 c = m.shuffle(typed_data.Float32x4.XZYX);
722 expect.Expect.equals(1.0, dart.dload(c, 'x'));
723 expect.Expect.equals(3.0, dart.dload(c, 'y'));
724 expect.Expect.equals(2.0, dart.dload(c, 'z'));
725 expect.Expect.equals(1.0, dart.dload(c, 'w'));
726 c = m.shuffle(typed_data.Float32x4.XZYY);
727 expect.Expect.equals(1.0, dart.dload(c, 'x'));
728 expect.Expect.equals(3.0, dart.dload(c, 'y'));
729 expect.Expect.equals(2.0, dart.dload(c, 'z'));
730 expect.Expect.equals(2.0, dart.dload(c, 'w'));
731 c = m.shuffle(typed_data.Float32x4.XZYZ);
732 expect.Expect.equals(1.0, dart.dload(c, 'x'));
733 expect.Expect.equals(3.0, dart.dload(c, 'y'));
734 expect.Expect.equals(2.0, dart.dload(c, 'z'));
735 expect.Expect.equals(3.0, dart.dload(c, 'w'));
736 c = m.shuffle(typed_data.Float32x4.XZYW);
737 expect.Expect.equals(1.0, dart.dload(c, 'x'));
738 expect.Expect.equals(3.0, dart.dload(c, 'y'));
739 expect.Expect.equals(2.0, dart.dload(c, 'z'));
740 expect.Expect.equals(4.0, dart.dload(c, 'w'));
741 c = m.shuffle(typed_data.Float32x4.XZZX);
742 expect.Expect.equals(1.0, dart.dload(c, 'x'));
743 expect.Expect.equals(3.0, dart.dload(c, 'y'));
744 expect.Expect.equals(3.0, dart.dload(c, 'z'));
745 expect.Expect.equals(1.0, dart.dload(c, 'w'));
746 c = m.shuffle(typed_data.Float32x4.XZZY);
747 expect.Expect.equals(1.0, dart.dload(c, 'x'));
748 expect.Expect.equals(3.0, dart.dload(c, 'y'));
749 expect.Expect.equals(3.0, dart.dload(c, 'z'));
750 expect.Expect.equals(2.0, dart.dload(c, 'w'));
751 c = m.shuffle(typed_data.Float32x4.XZZZ);
752 expect.Expect.equals(1.0, dart.dload(c, 'x'));
753 expect.Expect.equals(3.0, dart.dload(c, 'y'));
754 expect.Expect.equals(3.0, dart.dload(c, 'z'));
755 expect.Expect.equals(3.0, dart.dload(c, 'w'));
756 c = m.shuffle(typed_data.Float32x4.XZZW);
757 expect.Expect.equals(1.0, dart.dload(c, 'x'));
758 expect.Expect.equals(3.0, dart.dload(c, 'y'));
759 expect.Expect.equals(3.0, dart.dload(c, 'z'));
760 expect.Expect.equals(4.0, dart.dload(c, 'w'));
761 c = m.shuffle(typed_data.Float32x4.XZWX);
762 expect.Expect.equals(1.0, dart.dload(c, 'x'));
763 expect.Expect.equals(3.0, dart.dload(c, 'y'));
764 expect.Expect.equals(4.0, dart.dload(c, 'z'));
765 expect.Expect.equals(1.0, dart.dload(c, 'w'));
766 c = m.shuffle(typed_data.Float32x4.XZWY);
767 expect.Expect.equals(1.0, dart.dload(c, 'x'));
768 expect.Expect.equals(3.0, dart.dload(c, 'y'));
769 expect.Expect.equals(4.0, dart.dload(c, 'z'));
770 expect.Expect.equals(2.0, dart.dload(c, 'w'));
771 c = m.shuffle(typed_data.Float32x4.XZWZ);
772 expect.Expect.equals(1.0, dart.dload(c, 'x'));
773 expect.Expect.equals(3.0, dart.dload(c, 'y'));
774 expect.Expect.equals(4.0, dart.dload(c, 'z'));
775 expect.Expect.equals(3.0, dart.dload(c, 'w'));
776 c = m.shuffle(typed_data.Float32x4.XZWW);
777 expect.Expect.equals(1.0, dart.dload(c, 'x'));
778 expect.Expect.equals(3.0, dart.dload(c, 'y'));
779 expect.Expect.equals(4.0, dart.dload(c, 'z'));
780 expect.Expect.equals(4.0, dart.dload(c, 'w'));
781 }
782 dart.fn(testShuffle02, dart.void, []);
783 function testShuffle03() {
784 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
785 let c = null;
786 c = m.shuffle(typed_data.Float32x4.XWXX);
787 expect.Expect.equals(1.0, dart.dload(c, 'x'));
788 expect.Expect.equals(4.0, dart.dload(c, 'y'));
789 expect.Expect.equals(1.0, dart.dload(c, 'z'));
790 expect.Expect.equals(1.0, dart.dload(c, 'w'));
791 c = m.shuffle(typed_data.Float32x4.XWXY);
792 expect.Expect.equals(1.0, dart.dload(c, 'x'));
793 expect.Expect.equals(4.0, dart.dload(c, 'y'));
794 expect.Expect.equals(1.0, dart.dload(c, 'z'));
795 expect.Expect.equals(2.0, dart.dload(c, 'w'));
796 c = m.shuffle(typed_data.Float32x4.XWXZ);
797 expect.Expect.equals(1.0, dart.dload(c, 'x'));
798 expect.Expect.equals(4.0, dart.dload(c, 'y'));
799 expect.Expect.equals(1.0, dart.dload(c, 'z'));
800 expect.Expect.equals(3.0, dart.dload(c, 'w'));
801 c = m.shuffle(typed_data.Float32x4.XWXW);
802 expect.Expect.equals(1.0, dart.dload(c, 'x'));
803 expect.Expect.equals(4.0, dart.dload(c, 'y'));
804 expect.Expect.equals(1.0, dart.dload(c, 'z'));
805 expect.Expect.equals(4.0, dart.dload(c, 'w'));
806 c = m.shuffle(typed_data.Float32x4.XWYX);
807 expect.Expect.equals(1.0, dart.dload(c, 'x'));
808 expect.Expect.equals(4.0, dart.dload(c, 'y'));
809 expect.Expect.equals(2.0, dart.dload(c, 'z'));
810 expect.Expect.equals(1.0, dart.dload(c, 'w'));
811 c = m.shuffle(typed_data.Float32x4.XWYY);
812 expect.Expect.equals(1.0, dart.dload(c, 'x'));
813 expect.Expect.equals(4.0, dart.dload(c, 'y'));
814 expect.Expect.equals(2.0, dart.dload(c, 'z'));
815 expect.Expect.equals(2.0, dart.dload(c, 'w'));
816 c = m.shuffle(typed_data.Float32x4.XWYZ);
817 expect.Expect.equals(1.0, dart.dload(c, 'x'));
818 expect.Expect.equals(4.0, dart.dload(c, 'y'));
819 expect.Expect.equals(2.0, dart.dload(c, 'z'));
820 expect.Expect.equals(3.0, dart.dload(c, 'w'));
821 c = m.shuffle(typed_data.Float32x4.XWYW);
822 expect.Expect.equals(1.0, dart.dload(c, 'x'));
823 expect.Expect.equals(4.0, dart.dload(c, 'y'));
824 expect.Expect.equals(2.0, dart.dload(c, 'z'));
825 expect.Expect.equals(4.0, dart.dload(c, 'w'));
826 c = m.shuffle(typed_data.Float32x4.XWZX);
827 expect.Expect.equals(1.0, dart.dload(c, 'x'));
828 expect.Expect.equals(4.0, dart.dload(c, 'y'));
829 expect.Expect.equals(3.0, dart.dload(c, 'z'));
830 expect.Expect.equals(1.0, dart.dload(c, 'w'));
831 c = m.shuffle(typed_data.Float32x4.XWZY);
832 expect.Expect.equals(1.0, dart.dload(c, 'x'));
833 expect.Expect.equals(4.0, dart.dload(c, 'y'));
834 expect.Expect.equals(3.0, dart.dload(c, 'z'));
835 expect.Expect.equals(2.0, dart.dload(c, 'w'));
836 c = m.shuffle(typed_data.Float32x4.XWZZ);
837 expect.Expect.equals(1.0, dart.dload(c, 'x'));
838 expect.Expect.equals(4.0, dart.dload(c, 'y'));
839 expect.Expect.equals(3.0, dart.dload(c, 'z'));
840 expect.Expect.equals(3.0, dart.dload(c, 'w'));
841 c = m.shuffle(typed_data.Float32x4.XWZW);
842 expect.Expect.equals(1.0, dart.dload(c, 'x'));
843 expect.Expect.equals(4.0, dart.dload(c, 'y'));
844 expect.Expect.equals(3.0, dart.dload(c, 'z'));
845 expect.Expect.equals(4.0, dart.dload(c, 'w'));
846 c = m.shuffle(typed_data.Float32x4.XWWX);
847 expect.Expect.equals(1.0, dart.dload(c, 'x'));
848 expect.Expect.equals(4.0, dart.dload(c, 'y'));
849 expect.Expect.equals(4.0, dart.dload(c, 'z'));
850 expect.Expect.equals(1.0, dart.dload(c, 'w'));
851 c = m.shuffle(typed_data.Float32x4.XWWY);
852 expect.Expect.equals(1.0, dart.dload(c, 'x'));
853 expect.Expect.equals(4.0, dart.dload(c, 'y'));
854 expect.Expect.equals(4.0, dart.dload(c, 'z'));
855 expect.Expect.equals(2.0, dart.dload(c, 'w'));
856 c = m.shuffle(typed_data.Float32x4.XWWZ);
857 expect.Expect.equals(1.0, dart.dload(c, 'x'));
858 expect.Expect.equals(4.0, dart.dload(c, 'y'));
859 expect.Expect.equals(4.0, dart.dload(c, 'z'));
860 expect.Expect.equals(3.0, dart.dload(c, 'w'));
861 c = m.shuffle(typed_data.Float32x4.XWWW);
862 expect.Expect.equals(1.0, dart.dload(c, 'x'));
863 expect.Expect.equals(4.0, dart.dload(c, 'y'));
864 expect.Expect.equals(4.0, dart.dload(c, 'z'));
865 expect.Expect.equals(4.0, dart.dload(c, 'w'));
866 }
867 dart.fn(testShuffle03, dart.void, []);
868 function testShuffle10() {
869 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
870 let c = null;
871 c = m.shuffle(typed_data.Float32x4.YXXX);
872 expect.Expect.equals(2.0, dart.dload(c, 'x'));
873 expect.Expect.equals(1.0, dart.dload(c, 'y'));
874 expect.Expect.equals(1.0, dart.dload(c, 'z'));
875 expect.Expect.equals(1.0, dart.dload(c, 'w'));
876 c = m.shuffle(typed_data.Float32x4.YXXY);
877 expect.Expect.equals(2.0, dart.dload(c, 'x'));
878 expect.Expect.equals(1.0, dart.dload(c, 'y'));
879 expect.Expect.equals(1.0, dart.dload(c, 'z'));
880 expect.Expect.equals(2.0, dart.dload(c, 'w'));
881 c = m.shuffle(typed_data.Float32x4.YXXZ);
882 expect.Expect.equals(2.0, dart.dload(c, 'x'));
883 expect.Expect.equals(1.0, dart.dload(c, 'y'));
884 expect.Expect.equals(1.0, dart.dload(c, 'z'));
885 expect.Expect.equals(3.0, dart.dload(c, 'w'));
886 c = m.shuffle(typed_data.Float32x4.YXXW);
887 expect.Expect.equals(2.0, dart.dload(c, 'x'));
888 expect.Expect.equals(1.0, dart.dload(c, 'y'));
889 expect.Expect.equals(1.0, dart.dload(c, 'z'));
890 expect.Expect.equals(4.0, dart.dload(c, 'w'));
891 c = m.shuffle(typed_data.Float32x4.YXYX);
892 expect.Expect.equals(2.0, dart.dload(c, 'x'));
893 expect.Expect.equals(1.0, dart.dload(c, 'y'));
894 expect.Expect.equals(2.0, dart.dload(c, 'z'));
895 expect.Expect.equals(1.0, dart.dload(c, 'w'));
896 c = m.shuffle(typed_data.Float32x4.YXYY);
897 expect.Expect.equals(2.0, dart.dload(c, 'x'));
898 expect.Expect.equals(1.0, dart.dload(c, 'y'));
899 expect.Expect.equals(2.0, dart.dload(c, 'z'));
900 expect.Expect.equals(2.0, dart.dload(c, 'w'));
901 c = m.shuffle(typed_data.Float32x4.YXYZ);
902 expect.Expect.equals(2.0, dart.dload(c, 'x'));
903 expect.Expect.equals(1.0, dart.dload(c, 'y'));
904 expect.Expect.equals(2.0, dart.dload(c, 'z'));
905 expect.Expect.equals(3.0, dart.dload(c, 'w'));
906 c = m.shuffle(typed_data.Float32x4.YXYW);
907 expect.Expect.equals(2.0, dart.dload(c, 'x'));
908 expect.Expect.equals(1.0, dart.dload(c, 'y'));
909 expect.Expect.equals(2.0, dart.dload(c, 'z'));
910 expect.Expect.equals(4.0, dart.dload(c, 'w'));
911 c = m.shuffle(typed_data.Float32x4.YXZX);
912 expect.Expect.equals(2.0, dart.dload(c, 'x'));
913 expect.Expect.equals(1.0, dart.dload(c, 'y'));
914 expect.Expect.equals(3.0, dart.dload(c, 'z'));
915 expect.Expect.equals(1.0, dart.dload(c, 'w'));
916 c = m.shuffle(typed_data.Float32x4.YXZY);
917 expect.Expect.equals(2.0, dart.dload(c, 'x'));
918 expect.Expect.equals(1.0, dart.dload(c, 'y'));
919 expect.Expect.equals(3.0, dart.dload(c, 'z'));
920 expect.Expect.equals(2.0, dart.dload(c, 'w'));
921 c = m.shuffle(typed_data.Float32x4.YXZZ);
922 expect.Expect.equals(2.0, dart.dload(c, 'x'));
923 expect.Expect.equals(1.0, dart.dload(c, 'y'));
924 expect.Expect.equals(3.0, dart.dload(c, 'z'));
925 expect.Expect.equals(3.0, dart.dload(c, 'w'));
926 c = m.shuffle(typed_data.Float32x4.YXZW);
927 expect.Expect.equals(2.0, dart.dload(c, 'x'));
928 expect.Expect.equals(1.0, dart.dload(c, 'y'));
929 expect.Expect.equals(3.0, dart.dload(c, 'z'));
930 expect.Expect.equals(4.0, dart.dload(c, 'w'));
931 c = m.shuffle(typed_data.Float32x4.YXWX);
932 expect.Expect.equals(2.0, dart.dload(c, 'x'));
933 expect.Expect.equals(1.0, dart.dload(c, 'y'));
934 expect.Expect.equals(4.0, dart.dload(c, 'z'));
935 expect.Expect.equals(1.0, dart.dload(c, 'w'));
936 c = m.shuffle(typed_data.Float32x4.YXWY);
937 expect.Expect.equals(2.0, dart.dload(c, 'x'));
938 expect.Expect.equals(1.0, dart.dload(c, 'y'));
939 expect.Expect.equals(4.0, dart.dload(c, 'z'));
940 expect.Expect.equals(2.0, dart.dload(c, 'w'));
941 c = m.shuffle(typed_data.Float32x4.YXWZ);
942 expect.Expect.equals(2.0, dart.dload(c, 'x'));
943 expect.Expect.equals(1.0, dart.dload(c, 'y'));
944 expect.Expect.equals(4.0, dart.dload(c, 'z'));
945 expect.Expect.equals(3.0, dart.dload(c, 'w'));
946 c = m.shuffle(typed_data.Float32x4.YXWW);
947 expect.Expect.equals(2.0, dart.dload(c, 'x'));
948 expect.Expect.equals(1.0, dart.dload(c, 'y'));
949 expect.Expect.equals(4.0, dart.dload(c, 'z'));
950 expect.Expect.equals(4.0, dart.dload(c, 'w'));
951 }
952 dart.fn(testShuffle10, dart.void, []);
953 function testShuffle11() {
954 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
955 let c = null;
956 c = m.shuffle(typed_data.Float32x4.YYXX);
957 expect.Expect.equals(2.0, dart.dload(c, 'x'));
958 expect.Expect.equals(2.0, dart.dload(c, 'y'));
959 expect.Expect.equals(1.0, dart.dload(c, 'z'));
960 expect.Expect.equals(1.0, dart.dload(c, 'w'));
961 c = m.shuffle(typed_data.Float32x4.YYXY);
962 expect.Expect.equals(2.0, dart.dload(c, 'x'));
963 expect.Expect.equals(2.0, dart.dload(c, 'y'));
964 expect.Expect.equals(1.0, dart.dload(c, 'z'));
965 expect.Expect.equals(2.0, dart.dload(c, 'w'));
966 c = m.shuffle(typed_data.Float32x4.YYXZ);
967 expect.Expect.equals(2.0, dart.dload(c, 'x'));
968 expect.Expect.equals(2.0, dart.dload(c, 'y'));
969 expect.Expect.equals(1.0, dart.dload(c, 'z'));
970 expect.Expect.equals(3.0, dart.dload(c, 'w'));
971 c = m.shuffle(typed_data.Float32x4.YYXW);
972 expect.Expect.equals(2.0, dart.dload(c, 'x'));
973 expect.Expect.equals(2.0, dart.dload(c, 'y'));
974 expect.Expect.equals(1.0, dart.dload(c, 'z'));
975 expect.Expect.equals(4.0, dart.dload(c, 'w'));
976 c = m.shuffle(typed_data.Float32x4.YYYX);
977 expect.Expect.equals(2.0, dart.dload(c, 'x'));
978 expect.Expect.equals(2.0, dart.dload(c, 'y'));
979 expect.Expect.equals(2.0, dart.dload(c, 'z'));
980 expect.Expect.equals(1.0, dart.dload(c, 'w'));
981 c = m.shuffle(typed_data.Float32x4.YYYY);
982 expect.Expect.equals(2.0, dart.dload(c, 'x'));
983 expect.Expect.equals(2.0, dart.dload(c, 'y'));
984 expect.Expect.equals(2.0, dart.dload(c, 'z'));
985 expect.Expect.equals(2.0, dart.dload(c, 'w'));
986 c = m.shuffle(typed_data.Float32x4.YYYZ);
987 expect.Expect.equals(2.0, dart.dload(c, 'x'));
988 expect.Expect.equals(2.0, dart.dload(c, 'y'));
989 expect.Expect.equals(2.0, dart.dload(c, 'z'));
990 expect.Expect.equals(3.0, dart.dload(c, 'w'));
991 c = m.shuffle(typed_data.Float32x4.YYYW);
992 expect.Expect.equals(2.0, dart.dload(c, 'x'));
993 expect.Expect.equals(2.0, dart.dload(c, 'y'));
994 expect.Expect.equals(2.0, dart.dload(c, 'z'));
995 expect.Expect.equals(4.0, dart.dload(c, 'w'));
996 c = m.shuffle(typed_data.Float32x4.YYZX);
997 expect.Expect.equals(2.0, dart.dload(c, 'x'));
998 expect.Expect.equals(2.0, dart.dload(c, 'y'));
999 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1000 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1001 c = m.shuffle(typed_data.Float32x4.YYZY);
1002 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1003 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1004 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1005 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1006 c = m.shuffle(typed_data.Float32x4.YYZZ);
1007 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1008 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1009 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1010 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1011 c = m.shuffle(typed_data.Float32x4.YYZW);
1012 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1013 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1014 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1015 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1016 c = m.shuffle(typed_data.Float32x4.YYWX);
1017 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1018 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1019 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1020 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1021 c = m.shuffle(typed_data.Float32x4.YYWY);
1022 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1023 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1024 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1025 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1026 c = m.shuffle(typed_data.Float32x4.YYWZ);
1027 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1028 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1029 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1030 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1031 c = m.shuffle(typed_data.Float32x4.YYWW);
1032 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1033 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1034 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1035 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1036 }
1037 dart.fn(testShuffle11, dart.void, []);
1038 function testShuffle12() {
1039 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1040 let c = null;
1041 c = m.shuffle(typed_data.Float32x4.YZXX);
1042 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1043 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1044 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1045 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1046 c = m.shuffle(typed_data.Float32x4.YZXY);
1047 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1048 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1049 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1050 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1051 c = m.shuffle(typed_data.Float32x4.YZXZ);
1052 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1053 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1054 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1055 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1056 c = m.shuffle(typed_data.Float32x4.YZXW);
1057 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1058 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1059 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1060 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1061 c = m.shuffle(typed_data.Float32x4.YZYX);
1062 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1063 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1064 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1065 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1066 c = m.shuffle(typed_data.Float32x4.YZYY);
1067 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1068 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1069 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1070 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1071 c = m.shuffle(typed_data.Float32x4.YZYZ);
1072 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1073 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1074 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1075 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1076 c = m.shuffle(typed_data.Float32x4.YZYW);
1077 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1078 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1079 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1080 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1081 c = m.shuffle(typed_data.Float32x4.YZZX);
1082 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1083 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1084 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1085 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1086 c = m.shuffle(typed_data.Float32x4.YZZY);
1087 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1088 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1089 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1090 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1091 c = m.shuffle(typed_data.Float32x4.YZZZ);
1092 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1093 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1094 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1095 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1096 c = m.shuffle(typed_data.Float32x4.YZZW);
1097 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1098 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1099 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1100 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1101 c = m.shuffle(typed_data.Float32x4.YZWX);
1102 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1103 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1104 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1105 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1106 c = m.shuffle(typed_data.Float32x4.YZWY);
1107 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1108 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1109 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1110 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1111 c = m.shuffle(typed_data.Float32x4.YZWZ);
1112 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1113 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1114 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1115 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1116 c = m.shuffle(typed_data.Float32x4.YZWW);
1117 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1118 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1119 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1120 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1121 }
1122 dart.fn(testShuffle12, dart.void, []);
1123 function testShuffle13() {
1124 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1125 let c = null;
1126 c = m.shuffle(typed_data.Float32x4.YWXX);
1127 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1128 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1129 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1130 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1131 c = m.shuffle(typed_data.Float32x4.YWXY);
1132 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1133 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1134 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1135 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1136 c = m.shuffle(typed_data.Float32x4.YWXZ);
1137 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1138 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1139 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1140 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1141 c = m.shuffle(typed_data.Float32x4.YWXW);
1142 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1143 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1144 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1145 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1146 c = m.shuffle(typed_data.Float32x4.YWYX);
1147 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1148 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1149 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1150 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1151 c = m.shuffle(typed_data.Float32x4.YWYY);
1152 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1153 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1154 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1155 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1156 c = m.shuffle(typed_data.Float32x4.YWYZ);
1157 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1158 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1159 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1160 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1161 c = m.shuffle(typed_data.Float32x4.YWYW);
1162 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1163 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1164 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1165 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1166 c = m.shuffle(typed_data.Float32x4.YWZX);
1167 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1168 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1169 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1170 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1171 c = m.shuffle(typed_data.Float32x4.YWZY);
1172 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1173 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1174 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1175 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1176 c = m.shuffle(typed_data.Float32x4.YWZZ);
1177 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1178 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1179 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1180 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1181 c = m.shuffle(typed_data.Float32x4.YWZW);
1182 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1183 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1184 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1185 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1186 c = m.shuffle(typed_data.Float32x4.YWWX);
1187 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1188 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1189 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1190 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1191 c = m.shuffle(typed_data.Float32x4.YWWY);
1192 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1193 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1194 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1195 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1196 c = m.shuffle(typed_data.Float32x4.YWWZ);
1197 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1198 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1199 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1200 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1201 c = m.shuffle(typed_data.Float32x4.YWWW);
1202 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1203 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1204 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1205 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1206 }
1207 dart.fn(testShuffle13, dart.void, []);
1208 function testShuffle20() {
1209 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1210 let c = null;
1211 c = m.shuffle(typed_data.Float32x4.ZXXX);
1212 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1213 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1214 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1215 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1216 c = m.shuffle(typed_data.Float32x4.ZXXY);
1217 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1218 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1219 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1220 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1221 c = m.shuffle(typed_data.Float32x4.ZXXZ);
1222 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1223 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1224 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1225 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1226 c = m.shuffle(typed_data.Float32x4.ZXXW);
1227 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1228 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1229 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1230 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1231 c = m.shuffle(typed_data.Float32x4.ZXYX);
1232 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1233 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1234 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1235 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1236 c = m.shuffle(typed_data.Float32x4.ZXYY);
1237 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1238 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1239 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1240 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1241 c = m.shuffle(typed_data.Float32x4.ZXYZ);
1242 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1243 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1244 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1245 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1246 c = m.shuffle(typed_data.Float32x4.ZXYW);
1247 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1248 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1249 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1250 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1251 c = m.shuffle(typed_data.Float32x4.ZXZX);
1252 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1253 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1254 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1255 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1256 c = m.shuffle(typed_data.Float32x4.ZXZY);
1257 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1258 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1259 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1260 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1261 c = m.shuffle(typed_data.Float32x4.ZXZZ);
1262 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1263 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1264 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1265 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1266 c = m.shuffle(typed_data.Float32x4.ZXZW);
1267 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1268 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1269 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1270 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1271 c = m.shuffle(typed_data.Float32x4.ZXWX);
1272 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1273 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1274 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1275 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1276 c = m.shuffle(typed_data.Float32x4.ZXWY);
1277 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1278 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1279 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1280 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1281 c = m.shuffle(typed_data.Float32x4.ZXWZ);
1282 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1283 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1284 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1285 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1286 c = m.shuffle(typed_data.Float32x4.ZXWW);
1287 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1288 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1289 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1290 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1291 }
1292 dart.fn(testShuffle20, dart.void, []);
1293 function testShuffle21() {
1294 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1295 let c = null;
1296 c = m.shuffle(typed_data.Float32x4.ZYXX);
1297 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1298 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1299 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1300 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1301 c = m.shuffle(typed_data.Float32x4.ZYXY);
1302 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1303 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1304 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1305 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1306 c = m.shuffle(typed_data.Float32x4.ZYXZ);
1307 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1308 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1309 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1310 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1311 c = m.shuffle(typed_data.Float32x4.ZYXW);
1312 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1313 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1314 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1315 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1316 c = m.shuffle(typed_data.Float32x4.ZYYX);
1317 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1318 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1319 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1320 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1321 c = m.shuffle(typed_data.Float32x4.ZYYY);
1322 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1323 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1324 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1325 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1326 c = m.shuffle(typed_data.Float32x4.ZYYZ);
1327 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1328 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1329 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1330 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1331 c = m.shuffle(typed_data.Float32x4.ZYYW);
1332 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1333 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1334 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1335 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1336 c = m.shuffle(typed_data.Float32x4.ZYZX);
1337 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1338 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1339 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1340 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1341 c = m.shuffle(typed_data.Float32x4.ZYZY);
1342 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1343 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1344 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1345 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1346 c = m.shuffle(typed_data.Float32x4.ZYZZ);
1347 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1348 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1349 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1350 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1351 c = m.shuffle(typed_data.Float32x4.ZYZW);
1352 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1353 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1354 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1355 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1356 c = m.shuffle(typed_data.Float32x4.ZYWX);
1357 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1358 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1359 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1360 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1361 c = m.shuffle(typed_data.Float32x4.ZYWY);
1362 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1363 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1364 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1365 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1366 c = m.shuffle(typed_data.Float32x4.ZYWZ);
1367 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1368 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1369 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1370 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1371 c = m.shuffle(typed_data.Float32x4.ZYWW);
1372 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1373 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1374 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1375 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1376 }
1377 dart.fn(testShuffle21, dart.void, []);
1378 function testShuffle22() {
1379 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1380 let c = null;
1381 c = m.shuffle(typed_data.Float32x4.ZZXX);
1382 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1383 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1384 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1385 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1386 c = m.shuffle(typed_data.Float32x4.ZZXY);
1387 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1388 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1389 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1390 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1391 c = m.shuffle(typed_data.Float32x4.ZZXZ);
1392 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1393 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1394 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1395 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1396 c = m.shuffle(typed_data.Float32x4.ZZXW);
1397 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1398 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1399 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1400 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1401 c = m.shuffle(typed_data.Float32x4.ZZYX);
1402 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1403 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1404 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1405 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1406 c = m.shuffle(typed_data.Float32x4.ZZYY);
1407 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1408 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1409 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1410 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1411 c = m.shuffle(typed_data.Float32x4.ZZYZ);
1412 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1413 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1414 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1415 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1416 c = m.shuffle(typed_data.Float32x4.ZZYW);
1417 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1418 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1419 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1420 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1421 c = m.shuffle(typed_data.Float32x4.ZZZX);
1422 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1423 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1424 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1425 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1426 c = m.shuffle(typed_data.Float32x4.ZZZY);
1427 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1428 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1429 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1430 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1431 c = m.shuffle(typed_data.Float32x4.ZZZZ);
1432 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1433 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1434 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1435 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1436 c = m.shuffle(typed_data.Float32x4.ZZZW);
1437 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1438 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1439 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1440 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1441 c = m.shuffle(typed_data.Float32x4.ZZWX);
1442 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1443 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1444 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1445 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1446 c = m.shuffle(typed_data.Float32x4.ZZWY);
1447 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1448 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1449 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1450 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1451 c = m.shuffle(typed_data.Float32x4.ZZWZ);
1452 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1453 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1454 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1455 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1456 c = m.shuffle(typed_data.Float32x4.ZZWW);
1457 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1458 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1459 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1460 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1461 }
1462 dart.fn(testShuffle22, dart.void, []);
1463 function testShuffle23() {
1464 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1465 let c = null;
1466 c = m.shuffle(typed_data.Float32x4.ZWXX);
1467 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1468 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1469 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1470 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1471 c = m.shuffle(typed_data.Float32x4.ZWXY);
1472 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1473 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1474 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1475 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1476 c = m.shuffle(typed_data.Float32x4.ZWXZ);
1477 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1478 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1479 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1480 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1481 c = m.shuffle(typed_data.Float32x4.ZWXW);
1482 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1483 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1484 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1485 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1486 c = m.shuffle(typed_data.Float32x4.ZWYX);
1487 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1488 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1489 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1490 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1491 c = m.shuffle(typed_data.Float32x4.ZWYY);
1492 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1493 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1494 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1495 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1496 c = m.shuffle(typed_data.Float32x4.ZWYZ);
1497 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1498 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1499 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1500 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1501 c = m.shuffle(typed_data.Float32x4.ZWYW);
1502 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1503 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1504 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1505 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1506 c = m.shuffle(typed_data.Float32x4.ZWZX);
1507 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1508 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1509 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1510 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1511 c = m.shuffle(typed_data.Float32x4.ZWZY);
1512 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1513 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1514 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1515 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1516 c = m.shuffle(typed_data.Float32x4.ZWZZ);
1517 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1518 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1519 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1520 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1521 c = m.shuffle(typed_data.Float32x4.ZWZW);
1522 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1523 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1524 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1525 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1526 c = m.shuffle(typed_data.Float32x4.ZWWX);
1527 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1528 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1529 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1530 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1531 c = m.shuffle(typed_data.Float32x4.ZWWY);
1532 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1533 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1534 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1535 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1536 c = m.shuffle(typed_data.Float32x4.ZWWZ);
1537 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1538 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1539 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1540 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1541 c = m.shuffle(typed_data.Float32x4.ZWWW);
1542 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1543 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1544 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1545 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1546 }
1547 dart.fn(testShuffle23, dart.void, []);
1548 function testShuffle30() {
1549 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1550 let c = null;
1551 c = m.shuffle(typed_data.Float32x4.WXXX);
1552 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1553 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1554 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1555 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1556 c = m.shuffle(typed_data.Float32x4.WXXY);
1557 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1558 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1559 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1560 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1561 c = m.shuffle(typed_data.Float32x4.WXXZ);
1562 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1563 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1564 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1565 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1566 c = m.shuffle(typed_data.Float32x4.WXXW);
1567 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1568 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1569 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1570 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1571 c = m.shuffle(typed_data.Float32x4.WXYX);
1572 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1573 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1574 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1575 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1576 c = m.shuffle(typed_data.Float32x4.WXYY);
1577 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1578 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1579 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1580 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1581 c = m.shuffle(typed_data.Float32x4.WXYZ);
1582 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1583 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1584 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1585 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1586 c = m.shuffle(typed_data.Float32x4.WXYW);
1587 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1588 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1589 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1590 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1591 c = m.shuffle(typed_data.Float32x4.WXZX);
1592 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1593 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1594 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1595 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1596 c = m.shuffle(typed_data.Float32x4.WXZY);
1597 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1598 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1599 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1600 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1601 c = m.shuffle(typed_data.Float32x4.WXZZ);
1602 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1603 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1604 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1605 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1606 c = m.shuffle(typed_data.Float32x4.WXZW);
1607 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1608 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1609 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1610 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1611 c = m.shuffle(typed_data.Float32x4.WXWX);
1612 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1613 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1614 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1615 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1616 c = m.shuffle(typed_data.Float32x4.WXWY);
1617 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1618 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1619 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1620 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1621 c = m.shuffle(typed_data.Float32x4.WXWZ);
1622 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1623 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1624 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1625 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1626 c = m.shuffle(typed_data.Float32x4.WXWW);
1627 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1628 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1629 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1630 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1631 }
1632 dart.fn(testShuffle30, dart.void, []);
1633 function testShuffle31() {
1634 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1635 let c = null;
1636 c = m.shuffle(typed_data.Float32x4.WYXX);
1637 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1638 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1639 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1640 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1641 c = m.shuffle(typed_data.Float32x4.WYXY);
1642 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1643 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1644 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1645 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1646 c = m.shuffle(typed_data.Float32x4.WYXZ);
1647 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1648 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1649 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1650 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1651 c = m.shuffle(typed_data.Float32x4.WYXW);
1652 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1653 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1654 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1655 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1656 c = m.shuffle(typed_data.Float32x4.WYYX);
1657 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1658 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1659 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1660 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1661 c = m.shuffle(typed_data.Float32x4.WYYY);
1662 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1663 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1664 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1665 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1666 c = m.shuffle(typed_data.Float32x4.WYYZ);
1667 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1668 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1669 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1670 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1671 c = m.shuffle(typed_data.Float32x4.WYYW);
1672 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1673 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1674 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1675 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1676 c = m.shuffle(typed_data.Float32x4.WYZX);
1677 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1678 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1679 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1680 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1681 c = m.shuffle(typed_data.Float32x4.WYZY);
1682 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1683 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1684 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1685 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1686 c = m.shuffle(typed_data.Float32x4.WYZZ);
1687 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1688 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1689 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1690 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1691 c = m.shuffle(typed_data.Float32x4.WYZW);
1692 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1693 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1694 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1695 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1696 c = m.shuffle(typed_data.Float32x4.WYWX);
1697 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1698 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1699 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1700 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1701 c = m.shuffle(typed_data.Float32x4.WYWY);
1702 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1703 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1704 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1705 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1706 c = m.shuffle(typed_data.Float32x4.WYWZ);
1707 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1708 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1709 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1710 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1711 c = m.shuffle(typed_data.Float32x4.WYWW);
1712 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1713 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1714 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1715 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1716 }
1717 dart.fn(testShuffle31, dart.void, []);
1718 function testShuffle32() {
1719 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1720 let c = null;
1721 c = m.shuffle(typed_data.Float32x4.WZXX);
1722 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1723 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1724 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1725 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1726 c = m.shuffle(typed_data.Float32x4.WZXY);
1727 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1728 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1729 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1730 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1731 c = m.shuffle(typed_data.Float32x4.WZXZ);
1732 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1733 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1734 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1735 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1736 c = m.shuffle(typed_data.Float32x4.WZXW);
1737 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1738 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1739 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1740 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1741 c = m.shuffle(typed_data.Float32x4.WZYX);
1742 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1743 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1744 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1745 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1746 c = m.shuffle(typed_data.Float32x4.WZYY);
1747 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1748 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1749 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1750 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1751 c = m.shuffle(typed_data.Float32x4.WZYZ);
1752 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1753 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1754 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1755 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1756 c = m.shuffle(typed_data.Float32x4.WZYW);
1757 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1758 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1759 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1760 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1761 c = m.shuffle(typed_data.Float32x4.WZZX);
1762 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1763 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1764 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1765 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1766 c = m.shuffle(typed_data.Float32x4.WZZY);
1767 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1768 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1769 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1770 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1771 c = m.shuffle(typed_data.Float32x4.WZZZ);
1772 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1773 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1774 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1775 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1776 c = m.shuffle(typed_data.Float32x4.WZZW);
1777 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1778 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1779 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1780 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1781 c = m.shuffle(typed_data.Float32x4.WZWX);
1782 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1783 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1784 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1785 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1786 c = m.shuffle(typed_data.Float32x4.WZWY);
1787 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1788 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1789 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1790 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1791 c = m.shuffle(typed_data.Float32x4.WZWZ);
1792 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1793 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1794 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1795 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1796 c = m.shuffle(typed_data.Float32x4.WZWW);
1797 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1798 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1799 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1800 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1801 }
1802 dart.fn(testShuffle32, dart.void, []);
1803 function testShuffle33() {
1804 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1805 let c = null;
1806 c = m.shuffle(typed_data.Float32x4.WWXX);
1807 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1808 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1809 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1810 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1811 c = m.shuffle(typed_data.Float32x4.WWXY);
1812 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1813 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1814 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1815 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1816 c = m.shuffle(typed_data.Float32x4.WWXZ);
1817 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1818 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1819 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1820 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1821 c = m.shuffle(typed_data.Float32x4.WWXW);
1822 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1823 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1824 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1825 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1826 c = m.shuffle(typed_data.Float32x4.WWYX);
1827 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1828 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1829 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1830 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1831 c = m.shuffle(typed_data.Float32x4.WWYY);
1832 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1833 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1834 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1835 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1836 c = m.shuffle(typed_data.Float32x4.WWYZ);
1837 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1838 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1839 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1840 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1841 c = m.shuffle(typed_data.Float32x4.WWYW);
1842 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1843 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1844 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1845 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1846 c = m.shuffle(typed_data.Float32x4.WWZX);
1847 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1848 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1849 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1850 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1851 c = m.shuffle(typed_data.Float32x4.WWZY);
1852 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1853 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1854 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1855 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1856 c = m.shuffle(typed_data.Float32x4.WWZZ);
1857 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1858 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1859 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1860 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1861 c = m.shuffle(typed_data.Float32x4.WWZW);
1862 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1863 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1864 expect.Expect.equals(3.0, dart.dload(c, 'z'));
1865 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1866 c = m.shuffle(typed_data.Float32x4.WWWX);
1867 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1868 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1869 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1870 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1871 c = m.shuffle(typed_data.Float32x4.WWWY);
1872 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1873 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1874 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1875 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1876 c = m.shuffle(typed_data.Float32x4.WWWZ);
1877 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1878 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1879 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1880 expect.Expect.equals(3.0, dart.dload(c, 'w'));
1881 c = m.shuffle(typed_data.Float32x4.WWWW);
1882 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1883 expect.Expect.equals(4.0, dart.dload(c, 'y'));
1884 expect.Expect.equals(4.0, dart.dload(c, 'z'));
1885 expect.Expect.equals(4.0, dart.dload(c, 'w'));
1886 }
1887 dart.fn(testShuffle33, dart.void, []);
1888 function testShuffleNonConstant(mask) {
1889 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1890 let c = null;
1891 c = m.shuffle(dart.as(mask, core.int));
1892 if (dart.equals(mask, 1)) {
1893 expect.Expect.equals(2.0, dart.dload(c, 'x'));
1894 expect.Expect.equals(1.0, dart.dload(c, 'y'));
1895 expect.Expect.equals(1.0, dart.dload(c, 'z'));
1896 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1897 } else {
1898 expect.Expect.equals(dart.notNull(typed_data.Float32x4.YYYY) + 1, mask);
1899 expect.Expect.equals(3.0, dart.dload(c, 'x'));
1900 expect.Expect.equals(2.0, dart.dload(c, 'y'));
1901 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1902 expect.Expect.equals(2.0, dart.dload(c, 'w'));
1903 }
1904 }
1905 dart.fn(testShuffleNonConstant, dart.void, [dart.dynamic]);
1906 function testInvalidShuffle(mask) {
1907 expect.Expect.isFalse(dart.notNull(dart.as(dart.dsend(mask, '<=', 255), core .bool)) && dart.notNull(dart.as(dart.dsend(mask, '>=', 0), core.bool)));
1908 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1909 let c = null;
1910 expect.Expect.throws(dart.fn(() => {
1911 c = m.shuffle(dart.as(mask, core.int));
1912 }, dart.void, []));
1913 }
1914 dart.fn(testInvalidShuffle, dart.void, [dart.dynamic]);
1915 function testShuffle() {
1916 let m = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1917 let c = null;
1918 c = m.shuffle(typed_data.Float32x4.WZYX);
1919 expect.Expect.equals(4.0, dart.dload(c, 'x'));
1920 expect.Expect.equals(3.0, dart.dload(c, 'y'));
1921 expect.Expect.equals(2.0, dart.dload(c, 'z'));
1922 expect.Expect.equals(1.0, dart.dload(c, 'w'));
1923 }
1924 dart.fn(testShuffle, dart.void, []);
1925 function main() {
1926 let xxxx = dart.notNull(typed_data.Float32x4.XXXX) + 1;
1927 let yyyy = dart.notNull(typed_data.Float32x4.YYYY) + 1;
1928 for (let i = 0; i < 20; i++) {
1929 testShuffle();
1930 testShuffle00();
1931 testShuffle01();
1932 testShuffle02();
1933 testShuffle03();
1934 testShuffle10();
1935 testShuffle11();
1936 testShuffle12();
1937 testShuffle13();
1938 testShuffle20();
1939 testShuffle21();
1940 testShuffle22();
1941 testShuffle23();
1942 testShuffle30();
1943 testShuffle31();
1944 testShuffle32();
1945 testShuffle33();
1946 testShuffleNonConstant(xxxx);
1947 testShuffleNonConstant(yyyy);
1948 testInvalidShuffle(256);
1949 testInvalidShuffle(-1);
1950 }
1951 }
1952 dart.fn(main);
1953 // Exports:
1954 exports.testShuffle00 = testShuffle00;
1955 exports.testShuffle01 = testShuffle01;
1956 exports.testShuffle02 = testShuffle02;
1957 exports.testShuffle03 = testShuffle03;
1958 exports.testShuffle10 = testShuffle10;
1959 exports.testShuffle11 = testShuffle11;
1960 exports.testShuffle12 = testShuffle12;
1961 exports.testShuffle13 = testShuffle13;
1962 exports.testShuffle20 = testShuffle20;
1963 exports.testShuffle21 = testShuffle21;
1964 exports.testShuffle22 = testShuffle22;
1965 exports.testShuffle23 = testShuffle23;
1966 exports.testShuffle30 = testShuffle30;
1967 exports.testShuffle31 = testShuffle31;
1968 exports.testShuffle32 = testShuffle32;
1969 exports.testShuffle33 = testShuffle33;
1970 exports.testShuffleNonConstant = testShuffleNonConstant;
1971 exports.testInvalidShuffle = testInvalidShuffle;
1972 exports.testShuffle = testShuffle;
1973 exports.main = main;
1974 });
1975 dart_library.library('lib/typed_data/float32x4_sign_mask_test', null, /* Imports */[
1976 'dart/_runtime',
1977 'dart/typed_data',
1978 'expect/expect'
1979 ], /* Lazy imports */[
1980 ], function(exports, dart, typed_data, expect) {
1981 'use strict';
1982 let dartx = dart.dartx;
1983 function testImmediates() {
1984 let f = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
1985 let m = f.signMask;
1986 expect.Expect.equals(0, m);
1987 f = typed_data.Float32x4.new(-1.0, -2.0, -3.0, -0.0);
1988 m = f.signMask;
1989 expect.Expect.equals(15, m);
1990 f = typed_data.Float32x4.new(-1.0, 2.0, 3.0, 4.0);
1991 m = f.signMask;
1992 expect.Expect.equals(1, m);
1993 f = typed_data.Float32x4.new(1.0, -2.0, 3.0, 4.0);
1994 m = f.signMask;
1995 expect.Expect.equals(2, m);
1996 f = typed_data.Float32x4.new(1.0, 2.0, -3.0, 4.0);
1997 m = f.signMask;
1998 expect.Expect.equals(4, m);
1999 f = typed_data.Float32x4.new(1.0, 2.0, 3.0, -4.0);
2000 m = f.signMask;
2001 expect.Expect.equals(8, m);
2002 }
2003 dart.fn(testImmediates, dart.void, []);
2004 function testZero() {
2005 let f = typed_data.Float32x4.new(0.0, 0.0, 0.0, 0.0);
2006 let m = f.signMask;
2007 expect.Expect.equals(0, m);
2008 f = typed_data.Float32x4.new(-0.0, -0.0, -0.0, -0.0);
2009 m = f.signMask;
2010 expect.Expect.equals(15, m);
2011 }
2012 dart.fn(testZero, dart.void, []);
2013 function testArithmetic() {
2014 let a = typed_data.Float32x4.new(1.0, 1.0, 1.0, 1.0);
2015 let b = typed_data.Float32x4.new(2.0, 2.0, 2.0, 2.0);
2016 let c = typed_data.Float32x4.new(-1.0, -1.0, -1.0, -1.0);
2017 let m1 = a['-'](b).signMask;
2018 expect.Expect.equals(15, m1);
2019 let m2 = b['-'](a).signMask;
2020 expect.Expect.equals(0, m2);
2021 let m3 = c['*'](c).signMask;
2022 expect.Expect.equals(0, m3);
2023 let m4 = a['*'](c).signMask;
2024 expect.Expect.equals(15, m4);
2025 }
2026 dart.fn(testArithmetic, dart.void, []);
2027 function main() {
2028 for (let i = 0; i < 2000; i++) {
2029 testImmediates();
2030 testZero();
2031 testArithmetic();
2032 }
2033 }
2034 dart.fn(main);
2035 // Exports:
2036 exports.testImmediates = testImmediates;
2037 exports.testZero = testZero;
2038 exports.testArithmetic = testArithmetic;
2039 exports.main = main;
2040 });
2041 dart_library.library('lib/typed_data/float32x4_transpose_test', null, /* Imports */[
2042 'dart/_runtime',
2043 'expect/expect',
2044 'dart/typed_data'
2045 ], /* Lazy imports */[
2046 ], function(exports, dart, expect, typed_data) {
2047 'use strict';
2048 let dartx = dart.dartx;
2049 function transpose(m) {
2050 expect.Expect.equals(4, m.length);
2051 let m0 = m.get(0);
2052 let m1 = m.get(1);
2053 let m2 = m.get(2);
2054 let m3 = m.get(3);
2055 let t0 = m0.shuffleMix(m1, typed_data.Float32x4.XYXY);
2056 let t1 = m2.shuffleMix(m3, typed_data.Float32x4.XYXY);
2057 m.set(0, t0.shuffleMix(t1, typed_data.Float32x4.XZXZ));
2058 m.set(1, t0.shuffleMix(t1, typed_data.Float32x4.YWYW));
2059 let t2 = m0.shuffleMix(m1, typed_data.Float32x4.ZWZW);
2060 let t3 = m2.shuffleMix(m3, typed_data.Float32x4.ZWZW);
2061 m.set(2, t2.shuffleMix(t3, typed_data.Float32x4.XZXZ));
2062 m.set(3, t2.shuffleMix(t3, typed_data.Float32x4.YWYW));
2063 }
2064 dart.fn(transpose, dart.void, [typed_data.Float32x4List]);
2065 function testTranspose(m, r) {
2066 transpose(m);
2067 for (let i = 0; i < 4; i++) {
2068 let a = m.get(i);
2069 let b = r.get(i);
2070 expect.Expect.equals(b.x, a.x);
2071 expect.Expect.equals(b.y, a.y);
2072 expect.Expect.equals(b.z, a.z);
2073 expect.Expect.equals(b.w, a.w);
2074 }
2075 }
2076 dart.fn(testTranspose, dart.void, [typed_data.Float32x4List, typed_data.Float3 2x4List]);
2077 function main() {
2078 let A = typed_data.Float32x4List.new(4);
2079 A.set(0, typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0));
2080 A.set(1, typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0));
2081 A.set(2, typed_data.Float32x4.new(9.0, 10.0, 11.0, 12.0));
2082 A.set(3, typed_data.Float32x4.new(13.0, 14.0, 15.0, 16.0));
2083 let B = typed_data.Float32x4List.new(4);
2084 B.set(0, typed_data.Float32x4.new(1.0, 5.0, 9.0, 13.0));
2085 B.set(1, typed_data.Float32x4.new(2.0, 6.0, 10.0, 14.0));
2086 B.set(2, typed_data.Float32x4.new(3.0, 7.0, 11.0, 15.0));
2087 B.set(3, typed_data.Float32x4.new(4.0, 8.0, 12.0, 16.0));
2088 let I = typed_data.Float32x4List.new(4);
2089 I.set(0, typed_data.Float32x4.new(1.0, 0.0, 0.0, 0.0));
2090 I.set(1, typed_data.Float32x4.new(0.0, 1.0, 0.0, 0.0));
2091 I.set(2, typed_data.Float32x4.new(0.0, 0.0, 1.0, 0.0));
2092 I.set(3, typed_data.Float32x4.new(0.0, 0.0, 0.0, 1.0));
2093 for (let i = 0; i < 20; i++) {
2094 let m = typed_data.Float32x4List.fromList(I);
2095 testTranspose(m, I);
2096 m = typed_data.Float32x4List.fromList(A);
2097 testTranspose(m, B);
2098 }
2099 }
2100 dart.fn(main);
2101 // Exports:
2102 exports.transpose = transpose;
2103 exports.testTranspose = testTranspose;
2104 exports.main = main;
2105 });
2106 dart_library.library('lib/typed_data/float32x4_two_arg_shuffle_test', null, /* I mports */[
2107 'dart/_runtime',
2108 'dart/typed_data',
2109 'expect/expect'
2110 ], /* Lazy imports */[
2111 ], function(exports, dart, typed_data, expect) {
2112 'use strict';
2113 let dartx = dart.dartx;
2114 function testWithZWInXY() {
2115 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2116 let b = typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0);
2117 let c = b.shuffleMix(a, typed_data.Float32x4.ZWZW);
2118 expect.Expect.equals(7.0, c.x);
2119 expect.Expect.equals(8.0, c.y);
2120 expect.Expect.equals(3.0, c.z);
2121 expect.Expect.equals(4.0, c.w);
2122 }
2123 dart.fn(testWithZWInXY);
2124 function testInterleaveXY() {
2125 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2126 let b = typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0);
2127 let c = a.shuffleMix(b, typed_data.Float32x4.XYXY).shuffle(typed_data.Float3 2x4.XZYW);
2128 expect.Expect.equals(1.0, c.x);
2129 expect.Expect.equals(5.0, c.y);
2130 expect.Expect.equals(2.0, c.z);
2131 expect.Expect.equals(6.0, c.w);
2132 }
2133 dart.fn(testInterleaveXY);
2134 function testInterleaveZW() {
2135 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2136 let b = typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0);
2137 let c = a.shuffleMix(b, typed_data.Float32x4.ZWZW).shuffle(typed_data.Float3 2x4.XZYW);
2138 expect.Expect.equals(3.0, c.x);
2139 expect.Expect.equals(7.0, c.y);
2140 expect.Expect.equals(4.0, c.z);
2141 expect.Expect.equals(8.0, c.w);
2142 }
2143 dart.fn(testInterleaveZW);
2144 function testInterleaveXYPairs() {
2145 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2146 let b = typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0);
2147 let c = a.shuffleMix(b, typed_data.Float32x4.XYXY);
2148 expect.Expect.equals(1.0, c.x);
2149 expect.Expect.equals(2.0, c.y);
2150 expect.Expect.equals(5.0, c.z);
2151 expect.Expect.equals(6.0, c.w);
2152 }
2153 dart.fn(testInterleaveXYPairs);
2154 function testInterleaveZWPairs() {
2155 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2156 let b = typed_data.Float32x4.new(5.0, 6.0, 7.0, 8.0);
2157 let c = a.shuffleMix(b, typed_data.Float32x4.ZWZW);
2158 expect.Expect.equals(3.0, c.x);
2159 expect.Expect.equals(4.0, c.y);
2160 expect.Expect.equals(7.0, c.z);
2161 expect.Expect.equals(8.0, c.w);
2162 }
2163 dart.fn(testInterleaveZWPairs);
2164 function main() {
2165 for (let i = 0; i < 20; i++) {
2166 testWithZWInXY();
2167 testInterleaveXY();
2168 testInterleaveZW();
2169 testInterleaveXYPairs();
2170 testInterleaveZWPairs();
2171 }
2172 }
2173 dart.fn(main);
2174 // Exports:
2175 exports.testWithZWInXY = testWithZWInXY;
2176 exports.testInterleaveXY = testInterleaveXY;
2177 exports.testInterleaveZW = testInterleaveZW;
2178 exports.testInterleaveXYPairs = testInterleaveXYPairs;
2179 exports.testInterleaveZWPairs = testInterleaveZWPairs;
2180 exports.main = main;
2181 });
2182 dart_library.library('lib/typed_data/float32x4_unbox_phi_test', null, /* Imports */[
2183 'dart/_runtime',
2184 'dart/typed_data',
2185 'dart/core',
2186 'expect/expect'
2187 ], /* Lazy imports */[
2188 ], function(exports, dart, typed_data, core, expect) {
2189 'use strict';
2190 let dartx = dart.dartx;
2191 function testUnboxPhi(data) {
2192 let res = typed_data.Float32x4.zero();
2193 for (let i = 0; i < dart.notNull(data.length); i++) {
2194 res = res['+'](data.get(i));
2195 }
2196 return dart.notNull(res.x) + dart.notNull(res.y) + dart.notNull(res.z) + dar t.notNull(res.w);
2197 }
2198 dart.fn(testUnboxPhi, core.double, [typed_data.Float32x4List]);
2199 function main() {
2200 let list = typed_data.Float32x4List.new(10);
2201 let floatList = typed_data.Float32List.view(list.buffer);
2202 for (let i = 0; i < dart.notNull(floatList.length); i++) {
2203 floatList.set(i, i[dartx.toDouble]());
2204 }
2205 for (let i = 0; i < 20; i++) {
2206 let r = testUnboxPhi(list);
2207 expect.Expect.equals(780.0, r);
2208 }
2209 }
2210 dart.fn(main);
2211 // Exports:
2212 exports.testUnboxPhi = testUnboxPhi;
2213 exports.main = main;
2214 });
2215 dart_library.library('lib/typed_data/float32x4_unbox_regress_test', null, /* Imp orts */[
2216 'dart/_runtime',
2217 'dart/typed_data',
2218 'expect/expect'
2219 ], /* Lazy imports */[
2220 ], function(exports, dart, typed_data, expect) {
2221 'use strict';
2222 let dartx = dart.dartx;
2223 function testListStore(array, index, value) {
2224 dart.dsetindex(array, index, value);
2225 }
2226 dart.fn(testListStore);
2227 function testListStoreDeopt() {
2228 let list = null;
2229 let value = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2230 let smi = 12;
2231 list = typed_data.Float32x4List.new(8);
2232 for (let i = 0; i < 20; i++) {
2233 testListStore(list, 0, value);
2234 }
2235 try {
2236 testListStore(list, 0, smi);
2237 } catch (_) {
2238 }
2239
2240 }
2241 dart.fn(testListStoreDeopt, dart.void, []);
2242 function testAdd(a, b) {
2243 let c = dart.dsend(a, '+', b);
2244 expect.Expect.equals(3.0, dart.dload(c, 'x'));
2245 expect.Expect.equals(5.0, dart.dload(c, 'y'));
2246 expect.Expect.equals(7.0, dart.dload(c, 'z'));
2247 expect.Expect.equals(9.0, dart.dload(c, 'w'));
2248 }
2249 dart.fn(testAdd);
2250 function testAddDeopt() {
2251 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2252 let b = typed_data.Float32x4.new(2.0, 3.0, 4.0, 5.0);
2253 let smi = 12;
2254 for (let i = 0; i < 20; i++) {
2255 testAdd(a, b);
2256 }
2257 try {
2258 testAdd(a, smi);
2259 } catch (_) {
2260 }
2261
2262 }
2263 dart.fn(testAddDeopt, dart.void, []);
2264 function testGet(a) {
2265 let c = dart.dsend(dart.dsend(dart.dsend(dart.dload(a, 'x'), '+', dart.dload (a, 'y')), '+', dart.dload(a, 'z')), '+', dart.dload(a, 'w'));
2266 expect.Expect.equals(10.0, c);
2267 }
2268 dart.fn(testGet);
2269 function testGetDeopt() {
2270 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2271 let smi = 12;
2272 for (let i = 0; i < 20; i++) {
2273 testGet(a);
2274 }
2275 try {
2276 testGet(12);
2277 } catch (_) {
2278 }
2279
2280 for (let i = 0; i < 20; i++) {
2281 testGet(a);
2282 }
2283 }
2284 dart.fn(testGetDeopt, dart.void, []);
2285 function testComparison(a, b) {
2286 let r = dart.as(dart.dsend(a, 'equal', b), typed_data.Int32x4);
2287 expect.Expect.equals(true, r.flagX);
2288 expect.Expect.equals(false, r.flagY);
2289 expect.Expect.equals(false, r.flagZ);
2290 expect.Expect.equals(true, r.flagW);
2291 }
2292 dart.fn(testComparison, dart.void, [dart.dynamic, dart.dynamic]);
2293 function testComparisonDeopt() {
2294 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
2295 let b = typed_data.Float32x4.new(1.0, 2.1, 3.1, 4.0);
2296 let smi = 12;
2297 for (let i = 0; i < 20; i++) {
2298 testComparison(a, b);
2299 }
2300 try {
2301 testComparison(a, smi);
2302 } catch (_) {
2303 }
2304
2305 for (let i = 0; i < 20; i++) {
2306 testComparison(a, b);
2307 }
2308 try {
2309 testComparison(smi, a);
2310 } catch (_) {
2311 }
2312
2313 for (let i = 0; i < 20; i++) {
2314 testComparison(a, b);
2315 }
2316 }
2317 dart.fn(testComparisonDeopt, dart.void, []);
2318 function main() {
2319 testListStoreDeopt();
2320 testAddDeopt();
2321 testGetDeopt();
2322 testComparisonDeopt();
2323 }
2324 dart.fn(main);
2325 // Exports:
2326 exports.testListStore = testListStore;
2327 exports.testListStoreDeopt = testListStoreDeopt;
2328 exports.testAdd = testAdd;
2329 exports.testAddDeopt = testAddDeopt;
2330 exports.testGet = testGet;
2331 exports.testGetDeopt = testGetDeopt;
2332 exports.testComparison = testComparison;
2333 exports.testComparisonDeopt = testComparisonDeopt;
2334 exports.main = main;
2335 });
2336 dart_library.library('lib/typed_data/float64x2_typed_list_test', null, /* Import s */[
2337 'dart/_runtime',
2338 'dart/typed_data',
2339 'dart/core'
2340 ], /* Lazy imports */[
2341 ], function(exports, dart, typed_data, core) {
2342 'use strict';
2343 let dartx = dart.dartx;
2344 function test(l) {
2345 let a = l.get(0);
2346 let b = l.get(1);
2347 l.set(0, b);
2348 l.set(1, a);
2349 }
2350 dart.fn(test, dart.void, [typed_data.Float64x2List]);
2351 function compare(a, b) {
2352 return dart.equals(dart.dload(a, 'x'), dart.dload(b, 'x')) && dart.equals(da rt.dload(a, 'y'), dart.dload(b, 'y'));
2353 }
2354 dart.fn(compare, core.bool, [dart.dynamic, dart.dynamic]);
2355 function main() {
2356 let l = typed_data.Float64x2List.new(2);
2357 let a = typed_data.Float64x2.new(1.0, 2.0);
2358 let b = typed_data.Float64x2.new(3.0, 4.0);
2359 l.set(0, a);
2360 l.set(1, b);
2361 for (let i = 0; i < 41; i++) {
2362 test(l);
2363 }
2364 if (!dart.notNull(compare(l.get(0), b)) || !dart.notNull(compare(l.get(1), a ))) {
2365 dart.throw(123);
2366 }
2367 }
2368 dart.fn(main);
2369 // Exports:
2370 exports.test = test;
2371 exports.compare = compare;
2372 exports.main = main;
2373 });
2374 dart_library.library('lib/typed_data/int32x4_arithmetic_test', null, /* Imports */[
2375 'dart/_runtime',
2376 'dart/typed_data',
2377 'expect/expect'
2378 ], /* Lazy imports */[
2379 ], function(exports, dart, typed_data, expect) {
2380 'use strict';
2381 let dartx = dart.dartx;
2382 function testAdd() {
2383 let m = typed_data.Int32x4.new(0, 0, 0, 0);
2384 let n = typed_data.Int32x4.new(-1, -1, -1, -1);
2385 let o = m['+'](n);
2386 expect.Expect.equals(-1, o.x);
2387 expect.Expect.equals(-1, o.y);
2388 expect.Expect.equals(-1, o.z);
2389 expect.Expect.equals(-1, o.w);
2390 m = typed_data.Int32x4.new(0, 0, 0, 0);
2391 n = typed_data.Int32x4.new(4294967295, 4294967295, 4294967295, 4294967295);
2392 o = m['+'](n);
2393 expect.Expect.equals(-1, o.x);
2394 expect.Expect.equals(-1, o.y);
2395 expect.Expect.equals(-1, o.z);
2396 expect.Expect.equals(-1, o.w);
2397 n = typed_data.Int32x4.new(1, 1, 1, 1);
2398 m = typed_data.Int32x4.new(4294967295, 4294967295, 4294967295, 4294967295);
2399 o = m['+'](n);
2400 expect.Expect.equals(0, o.x);
2401 expect.Expect.equals(0, o.y);
2402 expect.Expect.equals(0, o.z);
2403 expect.Expect.equals(0, o.w);
2404 n = typed_data.Int32x4.new(4294967295, 4294967295, 4294967295, 4294967295);
2405 m = typed_data.Int32x4.new(4294967295, 4294967295, 4294967295, 4294967295);
2406 o = m['+'](n);
2407 expect.Expect.equals(-2, o.x);
2408 expect.Expect.equals(-2, o.y);
2409 expect.Expect.equals(-2, o.z);
2410 expect.Expect.equals(-2, o.w);
2411 n = typed_data.Int32x4.new(1, 0, 0, 0);
2412 m = typed_data.Int32x4.new(2, 0, 0, 0);
2413 o = n['+'](m);
2414 expect.Expect.equals(3, o.x);
2415 expect.Expect.equals(0, o.y);
2416 expect.Expect.equals(0, o.z);
2417 expect.Expect.equals(0, o.w);
2418 n = typed_data.Int32x4.new(1, 3, 0, 0);
2419 m = typed_data.Int32x4.new(2, 4, 0, 0);
2420 o = n['+'](m);
2421 expect.Expect.equals(3, o.x);
2422 expect.Expect.equals(7, o.y);
2423 expect.Expect.equals(0, o.z);
2424 expect.Expect.equals(0, o.w);
2425 n = typed_data.Int32x4.new(1, 3, 5, 0);
2426 m = typed_data.Int32x4.new(2, 4, 6, 0);
2427 o = n['+'](m);
2428 expect.Expect.equals(3, o.x);
2429 expect.Expect.equals(7, o.y);
2430 expect.Expect.equals(11, o.z);
2431 expect.Expect.equals(0, o.w);
2432 n = typed_data.Int32x4.new(1, 3, 5, 7);
2433 m = typed_data.Int32x4.new(-2, -4, -6, -8);
2434 o = n['+'](m);
2435 expect.Expect.equals(-1, o.x);
2436 expect.Expect.equals(-1, o.y);
2437 expect.Expect.equals(-1, o.z);
2438 expect.Expect.equals(-1, o.w);
2439 }
2440 dart.fn(testAdd);
2441 function testSub() {
2442 let m = typed_data.Int32x4.new(0, 0, 0, 0);
2443 let n = typed_data.Int32x4.new(1, 1, 1, 1);
2444 let o = m['-'](n);
2445 expect.Expect.equals(-1, o.x);
2446 expect.Expect.equals(-1, o.y);
2447 expect.Expect.equals(-1, o.z);
2448 expect.Expect.equals(-1, o.w);
2449 o = n['-'](m);
2450 expect.Expect.equals(1, o.x);
2451 expect.Expect.equals(1, o.y);
2452 expect.Expect.equals(1, o.z);
2453 expect.Expect.equals(1, o.w);
2454 }
2455 dart.fn(testSub);
2456 function main() {
2457 for (let i = 0; i < 20; i++) {
2458 testAdd();
2459 testSub();
2460 }
2461 }
2462 dart.fn(main);
2463 // Exports:
2464 exports.testAdd = testAdd;
2465 exports.testSub = testSub;
2466 exports.main = main;
2467 });
2468 dart_library.library('lib/typed_data/int32x4_bigint_test', null, /* Imports */[
2469 'dart/_runtime',
2470 'dart/typed_data',
2471 'expect/expect'
2472 ], /* Lazy imports */[
2473 ], function(exports, dart, typed_data, expect) {
2474 'use strict';
2475 let dartx = dart.dartx;
2476 function main() {
2477 let n = 18446744073709551617;
2478 let x = typed_data.Int32x4.new(n, 0, 0, 0);
2479 expect.Expect.equals(x.x, 1);
2480 }
2481 dart.fn(main);
2482 // Exports:
2483 exports.main = main;
2484 });
2485 dart_library.library('lib/typed_data/int32x4_list_test', null, /* Imports */[
2486 'dart/_runtime',
2487 'expect/expect',
2488 'dart/core',
2489 'dart/typed_data'
2490 ], /* Lazy imports */[
2491 ], function(exports, dart, expect, core, typed_data) {
2492 'use strict';
2493 let dartx = dart.dartx;
2494 function testLoadStore(array) {
2495 expect.Expect.equals(8, dart.dload(array, 'length'));
2496 expect.Expect.isTrue(dart.is(array, core.List$(typed_data.Int32x4)));
2497 dart.dsetindex(array, 0, typed_data.Int32x4.new(1, 2, 3, 4));
2498 expect.Expect.equals(1, dart.dload(dart.dindex(array, 0), 'x'));
2499 expect.Expect.equals(2, dart.dload(dart.dindex(array, 0), 'y'));
2500 expect.Expect.equals(3, dart.dload(dart.dindex(array, 0), 'z'));
2501 expect.Expect.equals(4, dart.dload(dart.dindex(array, 0), 'w'));
2502 dart.dsetindex(array, 1, dart.dindex(array, 0));
2503 dart.dsetindex(array, 0, dart.dsend(dart.dindex(array, 0), 'withX', 9));
2504 expect.Expect.equals(9, dart.dload(dart.dindex(array, 0), 'x'));
2505 expect.Expect.equals(2, dart.dload(dart.dindex(array, 0), 'y'));
2506 expect.Expect.equals(3, dart.dload(dart.dindex(array, 0), 'z'));
2507 expect.Expect.equals(4, dart.dload(dart.dindex(array, 0), 'w'));
2508 expect.Expect.equals(1, dart.dload(dart.dindex(array, 1), 'x'));
2509 expect.Expect.equals(2, dart.dload(dart.dindex(array, 1), 'y'));
2510 expect.Expect.equals(3, dart.dload(dart.dindex(array, 1), 'z'));
2511 expect.Expect.equals(4, dart.dload(dart.dindex(array, 1), 'w'));
2512 }
2513 dart.fn(testLoadStore);
2514 function testLoadStoreDeopt(array, index, value) {
2515 dart.dsetindex(array, index, value);
2516 expect.Expect.equals(dart.dload(value, 'x'), dart.dload(dart.dindex(array, i ndex), 'x'));
2517 expect.Expect.equals(dart.dload(value, 'y'), dart.dload(dart.dindex(array, i ndex), 'y'));
2518 expect.Expect.equals(dart.dload(value, 'z'), dart.dload(dart.dindex(array, i ndex), 'z'));
2519 expect.Expect.equals(dart.dload(value, 'w'), dart.dload(dart.dindex(array, i ndex), 'w'));
2520 }
2521 dart.fn(testLoadStoreDeopt);
2522 function testLoadStoreDeoptDriver() {
2523 let list = typed_data.Int32x4List.new(4);
2524 let value = typed_data.Int32x4.new(1, 2, 3, 4);
2525 for (let i = 0; i < 20; i++) {
2526 testLoadStoreDeopt(list, 0, value);
2527 }
2528 try {
2529 testLoadStoreDeopt(list, 5, value);
2530 } catch (_) {
2531 }
2532
2533 for (let i = 0; i < 20; i++) {
2534 testLoadStoreDeopt(list, 0, value);
2535 }
2536 try {
2537 testLoadStoreDeopt(null, 0, value);
2538 } catch (_) {
2539 }
2540
2541 for (let i = 0; i < 20; i++) {
2542 testLoadStoreDeopt(list, 0, value);
2543 }
2544 try {
2545 testLoadStoreDeopt(list, 0, null);
2546 } catch (_) {
2547 }
2548
2549 for (let i = 0; i < 20; i++) {
2550 testLoadStoreDeopt(list, 0, value);
2551 }
2552 try {
2553 testLoadStoreDeopt(list, 3.14159, value);
2554 } catch (_) {
2555 }
2556
2557 for (let i = 0; i < 20; i++) {
2558 testLoadStoreDeopt(list, 0, value);
2559 }
2560 try {
2561 testLoadStoreDeopt(list, 0, (4)[dartx.toDouble]());
2562 } catch (_) {
2563 }
2564
2565 for (let i = 0; i < 20; i++) {
2566 testLoadStoreDeopt(list, 0, value);
2567 }
2568 try {
2569 testLoadStoreDeopt([typed_data.Int32x4.new(2, 3, 4, 5)], 0, value);
2570 } catch (_) {
2571 }
2572
2573 for (let i = 0; i < 20; i++) {
2574 testLoadStoreDeopt(list, 0, value);
2575 }
2576 }
2577 dart.fn(testLoadStoreDeoptDriver);
2578 function testListZero() {
2579 let list = typed_data.Int32x4List.new(1);
2580 expect.Expect.equals(0, list.get(0).x);
2581 expect.Expect.equals(0, list.get(0).y);
2582 expect.Expect.equals(0, list.get(0).z);
2583 expect.Expect.equals(0, list.get(0).w);
2584 }
2585 dart.fn(testListZero);
2586 function testView(array) {
2587 expect.Expect.equals(8, dart.dload(array, 'length'));
2588 expect.Expect.isTrue(dart.is(array, core.List$(typed_data.Int32x4)));
2589 expect.Expect.equals(0, dart.dload(dart.dindex(array, 0), 'x'));
2590 expect.Expect.equals(1, dart.dload(dart.dindex(array, 0), 'y'));
2591 expect.Expect.equals(2, dart.dload(dart.dindex(array, 0), 'z'));
2592 expect.Expect.equals(3, dart.dload(dart.dindex(array, 0), 'w'));
2593 expect.Expect.equals(4, dart.dload(dart.dindex(array, 1), 'x'));
2594 expect.Expect.equals(5, dart.dload(dart.dindex(array, 1), 'y'));
2595 expect.Expect.equals(6, dart.dload(dart.dindex(array, 1), 'z'));
2596 expect.Expect.equals(7, dart.dload(dart.dindex(array, 1), 'w'));
2597 }
2598 dart.fn(testView);
2599 function testSublist(array) {
2600 expect.Expect.equals(8, dart.dload(array, 'length'));
2601 expect.Expect.isTrue(dart.is(array, typed_data.Int32x4List));
2602 let a = dart.dsend(array, 'sublist', 0, 1);
2603 expect.Expect.equals(1, dart.dload(a, 'length'));
2604 expect.Expect.equals(0, dart.dload(dart.dindex(a, 0), 'x'));
2605 expect.Expect.equals(1, dart.dload(dart.dindex(a, 0), 'y'));
2606 expect.Expect.equals(2, dart.dload(dart.dindex(a, 0), 'z'));
2607 expect.Expect.equals(3, dart.dload(dart.dindex(a, 0), 'w'));
2608 a = dart.dsend(array, 'sublist', 1, 2);
2609 expect.Expect.equals(4, dart.dload(dart.dindex(a, 0), 'x'));
2610 expect.Expect.equals(5, dart.dload(dart.dindex(a, 0), 'y'));
2611 expect.Expect.equals(6, dart.dload(dart.dindex(a, 0), 'z'));
2612 expect.Expect.equals(7, dart.dload(dart.dindex(a, 0), 'w'));
2613 a = dart.dsend(array, 'sublist', 0);
2614 expect.Expect.equals(dart.dload(a, 'length'), dart.dload(array, 'length'));
2615 for (let i = 0; i < dart.notNull(dart.as(dart.dload(array, 'length'), core.n um)); i++) {
2616 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'x'), dart.dload(da rt.dindex(a, i), 'x'));
2617 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'y'), dart.dload(da rt.dindex(a, i), 'y'));
2618 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'z'), dart.dload(da rt.dindex(a, i), 'z'));
2619 expect.Expect.equals(dart.dload(dart.dindex(array, i), 'w'), dart.dload(da rt.dindex(a, i), 'w'));
2620 }
2621 }
2622 dart.fn(testSublist);
2623 function testSpecialValues(array) {
2624 let tests = [[2410207675578512, 878082192], [2410209554626704, -1537836912], [2147483648, -2147483648], [-2147483648, -2147483648], [2147483647, 2147483647] , [-2147483647, -2147483647]];
2625 let int32x4 = null;
2626 for (let test of tests) {
2627 let input = dart.dindex(test, 0);
2628 let expected = dart.dindex(test, 1);
2629 int32x4 = typed_data.Int32x4.new(dart.as(input, core.int), 2, 3, 4);
2630 dart.dsetindex(array, 0, int32x4);
2631 int32x4 = dart.dindex(array, 0);
2632 expect.Expect.equals(expected, dart.dload(int32x4, 'x'));
2633 expect.Expect.equals(2, dart.dload(int32x4, 'y'));
2634 expect.Expect.equals(3, dart.dload(int32x4, 'z'));
2635 expect.Expect.equals(4, dart.dload(int32x4, 'w'));
2636 int32x4 = typed_data.Int32x4.new(1, dart.as(input, core.int), 3, 4);
2637 dart.dsetindex(array, 0, int32x4);
2638 int32x4 = dart.dindex(array, 0);
2639 expect.Expect.equals(1, dart.dload(int32x4, 'x'));
2640 expect.Expect.equals(expected, dart.dload(int32x4, 'y'));
2641 expect.Expect.equals(3, dart.dload(int32x4, 'z'));
2642 expect.Expect.equals(4, dart.dload(int32x4, 'w'));
2643 int32x4 = typed_data.Int32x4.new(1, 2, dart.as(input, core.int), 4);
2644 dart.dsetindex(array, 0, int32x4);
2645 int32x4 = dart.dindex(array, 0);
2646 expect.Expect.equals(1, dart.dload(int32x4, 'x'));
2647 expect.Expect.equals(2, dart.dload(int32x4, 'y'));
2648 expect.Expect.equals(expected, dart.dload(int32x4, 'z'));
2649 expect.Expect.equals(4, dart.dload(int32x4, 'w'));
2650 int32x4 = typed_data.Int32x4.new(1, 2, 3, dart.as(input, core.int));
2651 dart.dsetindex(array, 0, int32x4);
2652 int32x4 = dart.dindex(array, 0);
2653 expect.Expect.equals(1, dart.dload(int32x4, 'x'));
2654 expect.Expect.equals(2, dart.dload(int32x4, 'y'));
2655 expect.Expect.equals(3, dart.dload(int32x4, 'z'));
2656 expect.Expect.equals(expected, dart.dload(int32x4, 'w'));
2657 }
2658 }
2659 dart.fn(testSpecialValues, dart.void, [dart.dynamic]);
2660 function main() {
2661 let list = null;
2662 list = typed_data.Int32x4List.new(8);
2663 for (let i = 0; i < 20; i++) {
2664 testLoadStore(list);
2665 }
2666 for (let i = 0; i < 20; i++) {
2667 testSpecialValues(list);
2668 }
2669 let uint32List = typed_data.Uint32List.new(32);
2670 for (let i = 0; i < dart.notNull(uint32List.length); i++) {
2671 uint32List.set(i, i);
2672 }
2673 list = typed_data.Int32x4List.view(uint32List.buffer);
2674 for (let i = 0; i < 20; i++) {
2675 testView(list);
2676 }
2677 for (let i = 0; i < 20; i++) {
2678 testSublist(list);
2679 }
2680 for (let i = 0; i < 20; i++) {
2681 testLoadStore(list);
2682 }
2683 for (let i = 0; i < 20; i++) {
2684 testListZero();
2685 }
2686 for (let i = 0; i < 20; i++) {
2687 testSpecialValues(list);
2688 }
2689 testLoadStoreDeoptDriver();
2690 }
2691 dart.fn(main);
2692 // Exports:
2693 exports.testLoadStore = testLoadStore;
2694 exports.testLoadStoreDeopt = testLoadStoreDeopt;
2695 exports.testLoadStoreDeoptDriver = testLoadStoreDeoptDriver;
2696 exports.testListZero = testListZero;
2697 exports.testView = testView;
2698 exports.testSublist = testSublist;
2699 exports.testSpecialValues = testSpecialValues;
2700 exports.main = main;
2701 });
2702 dart_library.library('lib/typed_data/int32x4_shuffle_test', null, /* Imports */[
2703 'dart/_runtime',
2704 'dart/typed_data',
2705 'expect/expect',
2706 'dart/core'
2707 ], /* Lazy imports */[
2708 ], function(exports, dart, typed_data, expect, core) {
2709 'use strict';
2710 let dartx = dart.dartx;
2711 function testShuffle() {
2712 let m = typed_data.Int32x4.new(1, 2, 3, 4);
2713 let c = null;
2714 c = m.shuffle(typed_data.Int32x4.WZYX);
2715 expect.Expect.equals(4, dart.dload(c, 'x'));
2716 expect.Expect.equals(3, dart.dload(c, 'y'));
2717 expect.Expect.equals(2, dart.dload(c, 'z'));
2718 expect.Expect.equals(1, dart.dload(c, 'w'));
2719 }
2720 dart.fn(testShuffle, dart.void, []);
2721 function testShuffleNonConstant(mask) {
2722 let m = typed_data.Int32x4.new(1, 2, 3, 4);
2723 let c = null;
2724 c = m.shuffle(dart.as(mask, core.int));
2725 if (dart.equals(mask, 1)) {
2726 expect.Expect.equals(2, dart.dload(c, 'x'));
2727 expect.Expect.equals(1, dart.dload(c, 'y'));
2728 expect.Expect.equals(1, dart.dload(c, 'z'));
2729 expect.Expect.equals(1, dart.dload(c, 'w'));
2730 } else {
2731 expect.Expect.equals(dart.notNull(typed_data.Int32x4.YYYY) + 1, mask);
2732 expect.Expect.equals(3, dart.dload(c, 'x'));
2733 expect.Expect.equals(2, dart.dload(c, 'y'));
2734 expect.Expect.equals(2, dart.dload(c, 'z'));
2735 expect.Expect.equals(2, dart.dload(c, 'w'));
2736 }
2737 }
2738 dart.fn(testShuffleNonConstant, dart.void, [dart.dynamic]);
2739 function testShuffleMix() {
2740 let m = typed_data.Int32x4.new(1, 2, 3, 4);
2741 let n = typed_data.Int32x4.new(5, 6, 7, 8);
2742 let c = m.shuffleMix(n, typed_data.Int32x4.XYXY);
2743 expect.Expect.equals(1, c.x);
2744 expect.Expect.equals(2, c.y);
2745 expect.Expect.equals(5, c.z);
2746 expect.Expect.equals(6, c.w);
2747 }
2748 dart.fn(testShuffleMix, dart.void, []);
2749 function main() {
2750 let xxxx = dart.notNull(typed_data.Int32x4.XXXX) + 1;
2751 let yyyy = dart.notNull(typed_data.Int32x4.YYYY) + 1;
2752 for (let i = 0; i < 20; i++) {
2753 testShuffle();
2754 testShuffleNonConstant(xxxx);
2755 testShuffleNonConstant(yyyy);
2756 testShuffleMix();
2757 }
2758 }
2759 dart.fn(main);
2760 // Exports:
2761 exports.testShuffle = testShuffle;
2762 exports.testShuffleNonConstant = testShuffleNonConstant;
2763 exports.testShuffleMix = testShuffleMix;
2764 exports.main = main;
2765 });
2766 dart_library.library('lib/typed_data/int32x4_sign_mask_test', null, /* Imports * /[
2767 'dart/_runtime',
2768 'dart/typed_data',
2769 'expect/expect'
2770 ], /* Lazy imports */[
2771 ], function(exports, dart, typed_data, expect) {
2772 'use strict';
2773 let dartx = dart.dartx;
2774 function testImmediates() {
2775 let f = typed_data.Int32x4.new(1, 2, 3, 4);
2776 let m = f.signMask;
2777 expect.Expect.equals(0, m);
2778 f = typed_data.Int32x4.new(-1, -2, -3, -4);
2779 m = f.signMask;
2780 expect.Expect.equals(15, m);
2781 f = typed_data.Int32x4.bool(true, false, false, false);
2782 m = f.signMask;
2783 expect.Expect.equals(1, m);
2784 f = typed_data.Int32x4.bool(false, true, false, false);
2785 m = f.signMask;
2786 expect.Expect.equals(2, m);
2787 f = typed_data.Int32x4.bool(false, false, true, false);
2788 m = f.signMask;
2789 expect.Expect.equals(4, m);
2790 f = typed_data.Int32x4.bool(false, false, false, true);
2791 m = f.signMask;
2792 expect.Expect.equals(8, m);
2793 }
2794 dart.fn(testImmediates, dart.void, []);
2795 function testZero() {
2796 let f = typed_data.Int32x4.new(0, 0, 0, 0);
2797 let m = f.signMask;
2798 expect.Expect.equals(0, m);
2799 f = typed_data.Int32x4.new(-0, -0, -0, -0);
2800 m = f.signMask;
2801 expect.Expect.equals(0, m);
2802 }
2803 dart.fn(testZero, dart.void, []);
2804 function testLogic() {
2805 let a = typed_data.Int32x4.new(2147483648, 2147483648, 2147483648, 214748364 8);
2806 let b = typed_data.Int32x4.new(1879048192, 1879048192, 1879048192, 187904819 2);
2807 let c = typed_data.Int32x4.new(4026531840, 4026531840, 4026531840, 402653184 0);
2808 let m1 = a['&'](c).signMask;
2809 expect.Expect.equals(15, m1);
2810 let m2 = a['&'](b).signMask;
2811 expect.Expect.equals(0, m2);
2812 let m3 = b['^'](a).signMask;
2813 expect.Expect.equals(15, m3);
2814 let m4 = b['|'](c).signMask;
2815 expect.Expect.equals(15, m4);
2816 }
2817 dart.fn(testLogic, dart.void, []);
2818 function main() {
2819 for (let i = 0; i < 2000; i++) {
2820 testImmediates();
2821 testZero();
2822 testLogic();
2823 }
2824 }
2825 dart.fn(main);
2826 // Exports:
2827 exports.testImmediates = testImmediates;
2828 exports.testZero = testZero;
2829 exports.testLogic = testLogic;
2830 exports.main = main;
2831 });
2832 dart_library.library('lib/typed_data/int64_list_load_store_test', null, /* Impor ts */[
2833 'dart/_runtime',
2834 'expect/expect',
2835 'dart/typed_data'
2836 ], /* Lazy imports */[
2837 ], function(exports, dart, expect, typed_data) {
2838 'use strict';
2839 let dartx = dart.dartx;
2840 function testStoreLoad(l, z) {
2841 dart.dsetindex(l, 0, 9223372036854775807);
2842 dart.dsetindex(l, 1, 9223372036854775806);
2843 dart.dsetindex(l, 2, dart.dindex(l, 0));
2844 dart.dsetindex(l, 3, z);
2845 expect.Expect.equals(dart.dindex(l, 0), 9223372036854775807);
2846 expect.Expect.equals(dart.dindex(l, 1), 9223372036854775806);
2847 expect.Expect.isTrue(dart.dsend(dart.dindex(l, 1), '<', dart.dindex(l, 0)));
2848 expect.Expect.equals(dart.dindex(l, 2), dart.dindex(l, 0));
2849 expect.Expect.equals(dart.dindex(l, 3), z);
2850 }
2851 dart.fn(testStoreLoad, dart.void, [dart.dynamic, dart.dynamic]);
2852 function main() {
2853 let l = typed_data.Int64List.new(4);
2854 let zGood = 9223372036854775807;
2855 let zBad = false;
2856 for (let i = 0; i < 40; i++) {
2857 testStoreLoad(l, zGood);
2858 }
2859 try {
2860 testStoreLoad(l, zBad);
2861 } catch (_) {
2862 }
2863
2864 for (let i = 0; i < 40; i++) {
2865 testStoreLoad(l, zGood);
2866 }
2867 }
2868 dart.fn(main);
2869 // Exports:
2870 exports.testStoreLoad = testStoreLoad;
2871 exports.main = main;
2872 });
2873 dart_library.library('lib/typed_data/native_interceptor_no_own_method_to_interce pt_test', null, /* Imports */[
2874 'dart/_runtime',
2875 'dart/typed_data'
2876 ], /* Lazy imports */[
2877 ], function(exports, dart, typed_data) {
2878 'use strict';
2879 let dartx = dart.dartx;
2880 function use(s) {
2881 return s;
2882 }
2883 dart.fn(use);
2884 function main() {
2885 use(dart.toString(typed_data.ByteData.new(1)));
2886 }
2887 dart.fn(main);
2888 // Exports:
2889 exports.use = use;
2890 exports.main = main;
2891 });
2892 dart_library.library('lib/typed_data/setRange_1_test', null, /* Imports */[
2893 'dart/_runtime',
2894 'lib/typed_data/setRange_lib'
2895 ], /* Lazy imports */[
2896 ], function(exports, dart, setRange_lib) {
2897 'use strict';
2898 let dartx = dart.dartx;
2899 function sameTypeTest() {
2900 setRange_lib.checkSameSize(setRange_lib.makeInt16List, setRange_lib.makeInt1 6View, setRange_lib.makeInt16View);
2901 setRange_lib.checkSameSize(setRange_lib.makeUint16List, setRange_lib.makeUin t16View, setRange_lib.makeUint16View);
2902 }
2903 dart.fn(sameTypeTest);
2904 function main() {
2905 sameTypeTest();
2906 }
2907 dart.fn(main);
2908 // Exports:
2909 exports.sameTypeTest = sameTypeTest;
2910 exports.main = main;
2911 });
2912 dart_library.library('lib/typed_data/setRange_2_test', null, /* Imports */[
2913 'dart/_runtime',
2914 'lib/typed_data/setRange_lib'
2915 ], /* Lazy imports */[
2916 ], function(exports, dart, setRange_lib) {
2917 'use strict';
2918 let dartx = dart.dartx;
2919 function sameElementSizeTest() {
2920 setRange_lib.checkSameSize(setRange_lib.makeInt16List, setRange_lib.makeInt1 6View, setRange_lib.makeUint16View);
2921 setRange_lib.checkSameSize(setRange_lib.makeInt16List, setRange_lib.makeUint 16View, setRange_lib.makeInt16View);
2922 }
2923 dart.fn(sameElementSizeTest);
2924 function main() {
2925 sameElementSizeTest();
2926 }
2927 dart.fn(main);
2928 // Exports:
2929 exports.sameElementSizeTest = sameElementSizeTest;
2930 exports.main = main;
2931 });
2932 dart_library.library('lib/typed_data/setRange_3_test', null, /* Imports */[
2933 'dart/_runtime',
2934 'dart/typed_data',
2935 'lib/typed_data/setRange_lib',
2936 'expect/expect'
2937 ], /* Lazy imports */[
2938 ], function(exports, dart, typed_data, setRange_lib, expect) {
2939 'use strict';
2940 let dartx = dart.dartx;
2941 function expandContractTest() {
2942 let a1 = typed_data.Int32List.new(8);
2943 let buffer = a1.buffer;
2944 let a2 = typed_data.Int8List.view(buffer, 12, 8);
2945 setRange_lib.initialize(a2);
2946 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a2}`);
2947 a1.setRange(0, 8, a2);
2948 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a1}`);
2949 setRange_lib.initialize(a1);
2950 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a1}`);
2951 a2.setRange(0, 8, a1);
2952 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a2}`);
2953 }
2954 dart.fn(expandContractTest);
2955 function main() {
2956 expandContractTest();
2957 }
2958 dart.fn(main);
2959 // Exports:
2960 exports.expandContractTest = expandContractTest;
2961 exports.main = main;
2962 });
2963 dart_library.library('lib/typed_data/setRange_4_test', null, /* Imports */[
2964 'dart/_runtime',
2965 'dart/typed_data',
2966 'lib/typed_data/setRange_lib',
2967 'expect/expect'
2968 ], /* Lazy imports */[
2969 ], function(exports, dart, typed_data, setRange_lib, expect) {
2970 'use strict';
2971 let dartx = dart.dartx;
2972 function clampingTest() {
2973 let a1 = typed_data.Int8List.new(8);
2974 let a2 = typed_data.Uint8ClampedList.view(a1.buffer);
2975 setRange_lib.initialize(a1);
2976 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a1}`);
2977 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', `${a2}`);
2978 a1.set(0, -1);
2979 a2.setRange(0, 2, a1);
2980 expect.Expect.equals('[0, 2, 3, 4, 5, 6, 7, 8]', `${a2}`);
2981 }
2982 dart.fn(clampingTest);
2983 function main() {
2984 clampingTest();
2985 }
2986 dart.fn(main);
2987 // Exports:
2988 exports.clampingTest = clampingTest;
2989 exports.main = main;
2990 });
2991 dart_library.library('lib/typed_data/setRange_5_test', null, /* Imports */[
2992 'dart/_runtime',
2993 'dart/typed_data',
2994 'lib/typed_data/setRange_lib',
2995 'expect/expect'
2996 ], /* Lazy imports */[
2997 ], function(exports, dart, typed_data, setRange_lib, expect) {
2998 'use strict';
2999 let dartx = dart.dartx;
3000 function overlapTest() {
3001 let buffer = typed_data.Float32List.new(3).buffer;
3002 let a0 = typed_data.Int8List.view(buffer);
3003 let a1 = typed_data.Int8List.view(buffer, 1, 5);
3004 let a2 = typed_data.Int8List.view(buffer, 2, 5);
3005 setRange_lib.initialize(a0);
3006 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]', `${a0}`);
3007 expect.Expect.equals('[2, 3, 4, 5, 6]', `${a1}`);
3008 expect.Expect.equals('[3, 4, 5, 6, 7]', `${a2}`);
3009 a1.setRange(0, 5, a2);
3010 expect.Expect.equals('[1, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12]', `${a0}`);
3011 setRange_lib.initialize(a0);
3012 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]', `${a0}`);
3013 expect.Expect.equals('[2, 3, 4, 5, 6]', `${a1}`);
3014 expect.Expect.equals('[3, 4, 5, 6, 7]', `${a2}`);
3015 a2.setRange(0, 5, a1);
3016 expect.Expect.equals('[1, 2, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12]', `${a0}`);
3017 }
3018 dart.fn(overlapTest);
3019 function main() {
3020 overlapTest();
3021 }
3022 dart.fn(main);
3023 // Exports:
3024 exports.overlapTest = overlapTest;
3025 exports.main = main;
3026 });
3027 dart_library.library('lib/typed_data/setRange_lib', null, /* Imports */[
3028 'dart/_runtime',
3029 'dart/core',
3030 'dart/typed_data',
3031 'expect/expect'
3032 ], /* Lazy imports */[
3033 ], function(exports, dart, core, typed_data, expect) {
3034 'use strict';
3035 let dartx = dart.dartx;
3036 function initialize(a) {
3037 for (let i = 0; i < dart.notNull(dart.as(dart.dload(a, 'length'), core.num)) ; i++) {
3038 dart.dsetindex(a, i, i + 1);
3039 }
3040 }
3041 dart.fn(initialize);
3042 function makeInt16View(buffer, byteOffset, length) {
3043 return typed_data.Int16List.view(dart.as(buffer, typed_data.ByteBuffer), dar t.as(byteOffset, core.int), dart.as(length, core.int));
3044 }
3045 dart.fn(makeInt16View);
3046 function makeUint16View(buffer, byteOffset, length) {
3047 return typed_data.Uint16List.view(dart.as(buffer, typed_data.ByteBuffer), da rt.as(byteOffset, core.int), dart.as(length, core.int));
3048 }
3049 dart.fn(makeUint16View);
3050 function makeInt16List(length) {
3051 return typed_data.Int16List.new(dart.as(length, core.int));
3052 }
3053 dart.fn(makeInt16List);
3054 function makeUint16List(length) {
3055 return typed_data.Uint16List.new(dart.as(length, core.int));
3056 }
3057 dart.fn(makeUint16List);
3058 function checkSameSize(constructor0, constructor1, constructor2) {
3059 let a0 = dart.dcall(constructor0, 9);
3060 let buffer = dart.dload(a0, 'buffer');
3061 let a1 = dart.dcall(constructor1, buffer, 0, 7);
3062 let a2 = dart.dcall(constructor2, buffer, 2 * dart.notNull(dart.as(dart.dloa d(a0, 'elementSizeInBytes'), core.num)), 7);
3063 initialize(a0);
3064 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8, 9]', `${a0}`);
3065 expect.Expect.equals('[1, 2, 3, 4, 5, 6, 7]', `${a1}`);
3066 expect.Expect.equals('[3, 4, 5, 6, 7, 8, 9]', `${a2}`);
3067 initialize(a0);
3068 dart.dsend(a1, 'setRange', 0, 7, a2);
3069 expect.Expect.equals('[3, 4, 5, 6, 7, 8, 9, 8, 9]', `${a0}`);
3070 initialize(a0);
3071 dart.dsend(a2, 'setRange', 0, 7, a1);
3072 expect.Expect.equals('[1, 2, 1, 2, 3, 4, 5, 6, 7]', `${a0}`);
3073 initialize(a0);
3074 dart.dsend(a1, 'setRange', 1, 7, a2);
3075 expect.Expect.equals('[1, 3, 4, 5, 6, 7, 8, 8, 9]', `${a0}`);
3076 initialize(a0);
3077 dart.dsend(a2, 'setRange', 1, 7, a1);
3078 expect.Expect.equals('[1, 2, 3, 1, 2, 3, 4, 5, 6]', `${a0}`);
3079 initialize(a0);
3080 dart.dsend(a1, 'setRange', 0, 6, a2, 1);
3081 expect.Expect.equals('[4, 5, 6, 7, 8, 9, 7, 8, 9]', `${a0}`);
3082 initialize(a0);
3083 dart.dsend(a2, 'setRange', 0, 6, a1, 1);
3084 expect.Expect.equals('[1, 2, 2, 3, 4, 5, 6, 7, 9]', `${a0}`);
3085 }
3086 dart.fn(checkSameSize);
3087 // Exports:
3088 exports.initialize = initialize;
3089 exports.makeInt16View = makeInt16View;
3090 exports.makeUint16View = makeUint16View;
3091 exports.makeInt16List = makeInt16List;
3092 exports.makeUint16List = makeUint16List;
3093 exports.checkSameSize = checkSameSize;
3094 });
3095 dart_library.library('lib/typed_data/simd_store_to_load_forward_test', null, /* Imports */[
3096 'dart/_runtime',
3097 'dart/typed_data',
3098 'expect/expect'
3099 ], /* Lazy imports */[
3100 ], function(exports, dart, typed_data, expect) {
3101 'use strict';
3102 let dartx = dart.dartx;
3103 function testLoadStoreForwardingFloat32x4(l, v) {
3104 l.set(1, v);
3105 let r = l.get(1);
3106 return r;
3107 }
3108 dart.fn(testLoadStoreForwardingFloat32x4, typed_data.Float32x4, [typed_data.Fl oat32x4List, typed_data.Float32x4]);
3109 function main() {
3110 let l = typed_data.Float32x4List.new(4);
3111 let a = typed_data.Float32x4.new(1.0, 2.0, 3.0, 4.0);
3112 let b = null;
3113 for (let i = 0; i < 20; i++) {
3114 b = testLoadStoreForwardingFloat32x4(l, a);
3115 }
3116 expect.Expect.equals(a.x, b.x);
3117 expect.Expect.equals(a.y, b.y);
3118 expect.Expect.equals(a.z, b.z);
3119 expect.Expect.equals(a.w, b.w);
3120 }
3121 dart.fn(main);
3122 // Exports:
3123 exports.testLoadStoreForwardingFloat32x4 = testLoadStoreForwardingFloat32x4;
3124 exports.main = main;
3125 });
3126 dart_library.library('lib/typed_data/typed_data_from_list_test', null, /* Import s */[
3127 'dart/_runtime',
3128 'dart/collection',
3129 'dart/typed_data',
3130 'dart/core'
3131 ], /* Lazy imports */[
3132 ], function(exports, dart, collection, typed_data, core) {
3133 'use strict';
3134 let dartx = dart.dartx;
3135 function main() {
3136 let list = new collection.UnmodifiableListView([1, 2]);
3137 let typed = typed_data.Uint8List.fromList(dart.as(list, core.List$(core.int) ));
3138 if (typed.get(0) != 1 || typed.get(1) != 2 || typed.length != 2) {
3139 dart.throw('Test failed');
3140 }
3141 }
3142 dart.fn(main);
3143 // Exports:
3144 exports.main = main;
3145 });
3146 dart_library.library('lib/typed_data/typed_data_hierarchy_int64_test', null, /* Imports */[
3147 'dart/_runtime',
3148 'expect/expect',
3149 'dart/typed_data',
3150 'dart/core'
3151 ], /* Lazy imports */[
3152 ], function(exports, dart, expect, typed_data, core) {
3153 'use strict';
3154 let dartx = dart.dartx;
3155 exports.inscrutable = null;
3156 function implementsTypedData() {
3157 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int6 4List.new(1)), typed_data.TypedData));
3158 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 64List.new(1)), typed_data.TypedData));
3159 }
3160 dart.fn(implementsTypedData, dart.void, []);
3161 function implementsList() {
3162 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int6 4List.new(1)), core.List$(core.int)));
3163 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 64List.new(1)), core.List$(core.int)));
3164 }
3165 dart.fn(implementsList, dart.void, []);
3166 function main() {
3167 exports.inscrutable = dart.fn(x => x);
3168 implementsTypedData();
3169 implementsList();
3170 }
3171 dart.fn(main);
3172 // Exports:
3173 exports.implementsTypedData = implementsTypedData;
3174 exports.implementsList = implementsList;
3175 exports.main = main;
3176 });
3177 dart_library.library('lib/typed_data/typed_data_hierarchy_test', null, /* Import s */[
3178 'dart/_runtime',
3179 'expect/expect',
3180 'dart/typed_data',
3181 'dart/core'
3182 ], /* Lazy imports */[
3183 ], function(exports, dart, expect, typed_data, core) {
3184 'use strict';
3185 let dartx = dart.dartx;
3186 exports.inscrutable = null;
3187 function testClampedList() {
3188 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 8List.new(1)), typed_data.Uint8List));
3189 expect.Expect.isFalse(dart.is(typed_data.Uint8ClampedList.new(1), typed_data .Uint8List), 'Uint8ClampedList should not be a subtype of Uint8List ' + 'in opti mizable test');
3190 expect.Expect.isFalse(dart.is(dart.dcall(exports.inscrutable, typed_data.Uin t8ClampedList.new(1)), typed_data.Uint8List), 'Uint8ClampedList should not be a subtype of Uint8List in dynamic test');
3191 }
3192 dart.fn(testClampedList, dart.void, []);
3193 function implementsTypedData() {
3194 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Byte Data.new(1)), typed_data.TypedData));
3195 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t32List.new(1)), typed_data.TypedData));
3196 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t32x4List.new(1)), typed_data.TypedData));
3197 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t64List.new(1)), typed_data.TypedData));
3198 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int8 List.new(1)), typed_data.TypedData));
3199 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int1 6List.new(1)), typed_data.TypedData));
3200 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int3 2List.new(1)), typed_data.TypedData));
3201 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 8List.new(1)), typed_data.TypedData));
3202 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 8ClampedList.new(1)), typed_data.TypedData));
3203 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 16List.new(1)), typed_data.TypedData));
3204 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 32List.new(1)), typed_data.TypedData));
3205 }
3206 dart.fn(implementsTypedData, dart.void, []);
3207 function implementsList() {
3208 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t32List.new(1)), core.List$(core.double)));
3209 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t32x4List.new(1)), core.List$(typed_data.Float32x4)));
3210 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Floa t64List.new(1)), core.List$(core.double)));
3211 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int8 List.new(1)), core.List$(core.int)));
3212 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int1 6List.new(1)), core.List$(core.int)));
3213 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Int3 2List.new(1)), core.List$(core.int)));
3214 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 8List.new(1)), core.List$(core.int)));
3215 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 8ClampedList.new(1)), core.List$(core.int)));
3216 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 16List.new(1)), core.List$(core.int)));
3217 expect.Expect.isTrue(dart.is(dart.dcall(exports.inscrutable, typed_data.Uint 32List.new(1)), core.List$(core.int)));
3218 }
3219 dart.fn(implementsList, dart.void, []);
3220 function main() {
3221 exports.inscrutable = dart.fn(x => x);
3222 testClampedList();
3223 implementsTypedData();
3224 implementsList();
3225 }
3226 dart.fn(main);
3227 // Exports:
3228 exports.testClampedList = testClampedList;
3229 exports.implementsTypedData = implementsTypedData;
3230 exports.implementsList = implementsList;
3231 exports.main = main;
3232 });
3233 dart_library.library('lib/typed_data/typed_data_list_test', null, /* Imports */[
3234 'dart/_runtime',
3235 'expect/expect',
3236 'dart/core',
3237 'dart/typed_data'
3238 ], /* Lazy imports */[
3239 ], function(exports, dart, expect, core, typed_data) {
3240 'use strict';
3241 let dartx = dart.dartx;
3242 function confuse(x) {
3243 return x;
3244 }
3245 dart.fn(confuse);
3246 function testListFunctions(list, first, last, toElementType) {
3247 dart.assert(dart.dsend(dart.dload(list, 'length'), '>', 0));
3248 let reversed = dart.dload(list, 'reversed');
3249 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d load(dart.dsend(reversed, 'toList'), 'reversed'), 'toList'), core.List));
3250 let index = dart.as(dart.dsend(dart.dload(list, 'length'), '-', 1), core.int );
3251 for (let x of dart.as(reversed, core.Iterable)) {
3252 expect.Expect.equals(dart.dindex(list, index), x);
3253 index = dart.notNull(index) - 1;
3254 }
3255 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'add', 0), dart.void, [] ), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3256 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'addAll', [1, 2]), dart. void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dyna mic]));
3257 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'clear'), dart.void, []) , dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3258 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'insert', 0, 0), dart.vo id, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynami c]));
3259 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'insertAll', 0, [1, 2]), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dar t.dynamic]));
3260 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'remove', 0), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]) );
3261 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeAt', 0), dart.voi d, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic ]));
3262 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeLast'), dart.void , []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic] ));
3263 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeRange', 0, 1), da rt.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.d ynamic]));
3264 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, c ore.UnsupportedError), core.bool, [dart.dynamic]));
3265 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'replaceRange', 0, 1, [] ), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [d art.dynamic]));
3266 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'retainWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, c ore.UnsupportedError), core.bool, [dart.dynamic]));
3267 let map = dart.dsend(list, 'asMap');
3268 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(map, 'length'));
3269 expect.Expect.isTrue(dart.is(map, core.Map));
3270 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d load(map, 'values'), 'toList'), core.List));
3271 for (let i = 0; i < dart.notNull(dart.as(dart.dload(list, 'length'), core.nu m)); i++) {
3272 expect.Expect.equals(dart.dindex(list, i), dart.dindex(map, i));
3273 }
3274 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'getRange', 0, dart.dload(list, 'length')), 'toList'), core.List));
3275 let subRange = dart.dsend(dart.dsend(list, 'getRange', 1, dart.dsend(dart.dl oad(list, 'length'), '-', 1)), 'toList');
3276 expect.Expect.equals(dart.dsend(dart.dload(list, 'length'), '-', 2), dart.dl oad(subRange, 'length'));
3277 index = 1;
3278 for (let x of dart.as(subRange, core.Iterable)) {
3279 expect.Expect.equals(dart.dindex(list, index), x);
3280 index = dart.notNull(index) + 1;
3281 }
3282 expect.Expect.equals(0, dart.dsend(list, 'lastIndexOf', first));
3283 expect.Expect.equals(dart.dsend(dart.dload(list, 'length'), '-', 1), dart.ds end(list, 'lastIndexOf', last));
3284 expect.Expect.equals(-1, dart.dsend(list, 'lastIndexOf', -1));
3285 let copy = dart.dsend(list, 'toList');
3286 dart.dsend(list, 'fillRange', 1, dart.dsend(dart.dload(list, 'length'), '-', 1), dart.dcall(toElementType, 0));
3287 expect.Expect.equals(dart.dload(copy, 'first'), dart.dload(list, 'first'));
3288 expect.Expect.equals(dart.dload(copy, 'last'), dart.dload(list, 'last'));
3289 for (let i = 1; i < dart.notNull(dart.as(dart.dsend(dart.dload(list, 'length '), '-', 1), core.num)); i++) {
3290 expect.Expect.equals(0, dart.dindex(list, i));
3291 }
3292 dart.dsend(list, 'setAll', 1, dart.dsend(dart.dsend(list, 'getRange', 1, dar t.dsend(dart.dload(list, 'length'), '-', 1)), 'map', dart.fn(x => dart.dcall(toE lementType, 2))));
3293 expect.Expect.equals(dart.dload(copy, 'first'), dart.dload(list, 'first'));
3294 expect.Expect.equals(dart.dload(copy, 'last'), dart.dload(list, 'last'));
3295 for (let i = 1; i < dart.notNull(dart.as(dart.dsend(dart.dload(list, 'length '), '-', 1), core.num)); i++) {
3296 expect.Expect.equals(2, dart.dindex(list, i));
3297 }
3298 dart.dsend(list, 'setRange', 1, dart.dsend(dart.dload(list, 'length'), '-', 1), core.Iterable.generate(dart.as(dart.dsend(dart.dload(list, 'length'), '-', 2 ), core.int), dart.fn(x => dart.dcall(toElementType, dart.notNull(x) + 5), dart. dynamic, [core.int])));
3299 expect.Expect.equals(first, dart.dload(list, 'first'));
3300 expect.Expect.equals(last, dart.dload(list, 'last'));
3301 for (let i = 1; i < dart.notNull(dart.as(dart.dsend(dart.dload(list, 'length '), '-', 1), core.num)); i++) {
3302 expect.Expect.equals(4 + i, dart.dindex(list, i));
3303 }
3304 dart.dsend(list, 'setRange', 1, dart.dsend(dart.dload(list, 'length'), '-', 1), core.Iterable.generate(dart.as(dart.dsend(dart.dload(list, 'length'), '-', 1 ), core.int), dart.fn(x => dart.dcall(toElementType, dart.notNull(x) + 5), dart. dynamic, [core.int])), 1);
3305 expect.Expect.equals(first, dart.dload(list, 'first'));
3306 expect.Expect.equals(last, dart.dload(list, 'last'));
3307 for (let i = 1; i < dart.notNull(dart.as(dart.dsend(dart.dload(list, 'length '), '-', 1), core.num)); i++) {
3308 expect.Expect.equals(5 + i, dart.dindex(list, i));
3309 }
3310 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'setRange', 1, dart.dsen d(dart.dload(list, 'length'), '-', 1), []), dart.void, []), dart.fn(e => dart.is (e, core.StateError), core.bool, [dart.dynamic]));
3311 for (let i = 0; i < dart.notNull(dart.as(dart.dload(list, 'length'), core.nu m)); i++) {
3312 dart.dsetindex(list, dart.dsend(dart.dsend(dart.dload(list, 'length'), '-' , 1), '-', i), dart.dcall(toElementType, i));
3313 }
3314 dart.dsend(list, 'sort');
3315 for (let i = 0; i < dart.notNull(dart.as(dart.dload(list, 'length'), core.nu m)); i++) {
3316 expect.Expect.equals(i, dart.dindex(list, i));
3317 }
3318 expect.Expect.listEquals(dart.as(dart.dsend(dart.dsend(list, 'getRange', 1, dart.dsend(dart.dload(list, 'length'), '-', 1)), 'toList'), core.List), dart.as( dart.dsend(list, 'sublist', 1, dart.dsend(dart.dload(list, 'length'), '-', 1)), core.List));
3319 expect.Expect.listEquals(dart.as(dart.dsend(dart.dsend(list, 'getRange', 1, dart.dload(list, 'length')), 'toList'), core.List), dart.as(dart.dsend(list, 'su blist', 1), core.List));
3320 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(list, 'sublist', 0), core.List));
3321 expect.Expect.listEquals([], dart.as(dart.dsend(list, 'sublist', 0, 0), core .List));
3322 expect.Expect.listEquals([], dart.as(dart.dsend(list, 'sublist', dart.dload( list, 'length')), core.List));
3323 expect.Expect.listEquals([], dart.as(dart.dsend(list, 'sublist', dart.dload( list, 'length'), dart.dload(list, 'length')), core.List));
3324 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'sublist', dart.dsend(da rt.dload(list, 'length'), '+', 1)), dart.void, []), dart.fn(e => dart.is(e, core .RangeError), core.bool, [dart.dynamic]));
3325 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'sublist', 0, dart.dsend (dart.dload(list, 'length'), '+', 1)), dart.void, []), dart.fn(e => dart.is(e, c ore.RangeError), core.bool, [dart.dynamic]));
3326 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'sublist', 1, 0), dart.v oid, []), dart.fn(e => dart.is(e, core.RangeError), core.bool, [dart.dynamic]));
3327 }
3328 dart.fn(testListFunctions, dart.void, [dart.dynamic, dart.dynamic, dart.dynami c, dart.dynamic]);
3329 function emptyChecks(list) {
3330 dart.assert(dart.equals(dart.dload(list, 'length'), 0));
3331 expect.Expect.isTrue(dart.dload(list, 'isEmpty'));
3332 let reversed = dart.dload(list, 'reversed');
3333 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d load(dart.dsend(reversed, 'toList'), 'reversed'), 'toList'), core.List));
3334 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'add', 0), dart.void, [] ), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3335 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'addAll', [1, 2]), dart. void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dyna mic]));
3336 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'clear'), dart.void, []) , dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3337 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'insert', 0, 0), dart.vo id, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynami c]));
3338 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'insertAll', 0, [1, 2]), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dar t.dynamic]));
3339 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'remove', 0), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]) );
3340 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeAt', 0), dart.voi d, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic ]));
3341 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeLast'), dart.void , []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic] ));
3342 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeRange', 0, 1), da rt.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.d ynamic]));
3343 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'removeWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, c ore.UnsupportedError), core.bool, [dart.dynamic]));
3344 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'replaceRange', 0, 1, [] ), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [d art.dynamic]));
3345 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'retainWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, c ore.UnsupportedError), core.bool, [dart.dynamic]));
3346 let map = dart.dsend(list, 'asMap');
3347 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(map, 'length'));
3348 expect.Expect.isTrue(dart.is(map, core.Map));
3349 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d load(map, 'values'), 'toList'), core.List));
3350 for (let i = 0; i < dart.notNull(dart.as(dart.dload(list, 'length'), core.nu m)); i++) {
3351 expect.Expect.equals(dart.dindex(list, i), dart.dindex(map, i));
3352 }
3353 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'getRange', 0, dart.dload(list, 'length')), 'toList'), core.List));
3354 expect.Expect.equals(-1, dart.dsend(list, 'lastIndexOf', -1));
3355 let copy = dart.dsend(list, 'toList');
3356 dart.dsend(list, 'fillRange', 0, 0);
3357 expect.Expect.listEquals([], dart.as(dart.dsend(dart.dsend(list, 'getRange', 0, 0), 'toList'), core.List));
3358 dart.dsend(list, 'setRange', 0, 0, [1, 2]);
3359 dart.dsend(list, 'sort');
3360 expect.Expect.listEquals([], dart.as(dart.dsend(list, 'sublist', 0, 0), core .List));
3361 }
3362 dart.fn(emptyChecks, dart.void, [dart.dynamic]);
3363 function main() {
3364 function toDouble(x) {
3365 return dart.dsend(x, 'toDouble');
3366 }
3367 dart.fn(toDouble);
3368 function toInt(x) {
3369 return dart.dsend(x, 'toInt');
3370 }
3371 dart.fn(toInt);
3372 testListFunctions(typed_data.Float32List.fromList(dart.list([1.5, 6.3, 9.5], core.double)), 1.5, 9.5, toDouble);
3373 testListFunctions(typed_data.Float64List.fromList(dart.list([1.5, 6.3, 9.5], core.double)), 1.5, 9.5, toDouble);
3374 testListFunctions(typed_data.Int8List.fromList(dart.list([3, 5, 9], core.int )), 3, 9, toInt);
3375 testListFunctions(typed_data.Int16List.fromList(dart.list([3, 5, 9], core.in t)), 3, 9, toInt);
3376 testListFunctions(typed_data.Int32List.fromList(dart.list([3, 5, 9], core.in t)), 3, 9, toInt);
3377 testListFunctions(typed_data.Uint8List.fromList(dart.list([3, 5, 9], core.in t)), 3, 9, toInt);
3378 testListFunctions(typed_data.Uint16List.fromList(dart.list([3, 5, 9], core.i nt)), 3, 9, toInt);
3379 testListFunctions(typed_data.Uint32List.fromList(dart.list([3, 5, 9], core.i nt)), 3, 9, toInt);
3380 emptyChecks(typed_data.Float32List.new(0));
3381 emptyChecks(typed_data.Float64List.new(0));
3382 emptyChecks(typed_data.Int8List.new(0));
3383 emptyChecks(typed_data.Int16List.new(0));
3384 emptyChecks(typed_data.Int32List.new(0));
3385 emptyChecks(typed_data.Uint8List.new(0));
3386 emptyChecks(typed_data.Uint16List.new(0));
3387 emptyChecks(typed_data.Uint32List.new(0));
3388 }
3389 dart.fn(main);
3390 // Exports:
3391 exports.confuse = confuse;
3392 exports.testListFunctions = testListFunctions;
3393 exports.emptyChecks = emptyChecks;
3394 exports.main = main;
3395 });
3396 dart_library.library('lib/typed_data/typed_data_load2_test', null, /* Imports */ [
3397 'dart/_runtime',
3398 'dart/typed_data',
3399 'expect/expect'
3400 ], /* Lazy imports */[
3401 ], function(exports, dart, typed_data, expect) {
3402 'use strict';
3403 let dartx = dart.dartx;
3404 function aliasWithByteData1() {
3405 let aa = typed_data.Int8List.new(10);
3406 let b = typed_data.ByteData.view(aa.buffer);
3407 for (let i = 0; i < dart.notNull(aa.length); i++)
3408 aa.set(i, 9);
3409 let x1 = aa.get(3);
3410 b.setInt8(3, 1);
3411 let x2 = aa.get(3);
3412 expect.Expect.equals(9, x1);
3413 expect.Expect.equals(1, x2);
3414 }
3415 dart.fn(aliasWithByteData1);
3416 function aliasWithByteData2() {
3417 let b = typed_data.ByteData.new(10);
3418 let aa = typed_data.Int8List.view(b.buffer);
3419 for (let i = 0; i < dart.notNull(aa.length); i++)
3420 aa.set(i, 9);
3421 let x1 = aa.get(3);
3422 b.setInt8(3, 1);
3423 let x2 = aa.get(3);
3424 expect.Expect.equals(9, x1);
3425 expect.Expect.equals(1, x2);
3426 }
3427 dart.fn(aliasWithByteData2);
3428 function alias8x8() {
3429 let buffer = typed_data.Int8List.new(10).buffer;
3430 let a1 = typed_data.Int8List.view(buffer);
3431 let a2 = typed_data.Int8List.view(buffer, 1);
3432 for (let i = 0; i < dart.notNull(a1.length); i++)
3433 a1.set(i, 9);
3434 let x1 = a1.get(1);
3435 a2.set(0, 0);
3436 let x2 = a1.get(1);
3437 expect.Expect.equals(9, x1);
3438 expect.Expect.equals(0, x2);
3439 for (let i = 0; i < dart.notNull(a1.length); i++)
3440 a1.set(i, 9);
3441 x1 = a1.get(1);
3442 a2.set(1, 5);
3443 x2 = a1.get(1);
3444 expect.Expect.equals(9, x1);
3445 expect.Expect.equals(9, x2);
3446 }
3447 dart.fn(alias8x8);
3448 function alias8x16() {
3449 let a1 = typed_data.Int8List.new(10);
3450 let a2 = typed_data.Int16List.view(a1.buffer);
3451 for (let i = 0; i < dart.notNull(a1.length); i++)
3452 a1.set(i, 9);
3453 let x1 = a1.get(0);
3454 a2.set(0, 257);
3455 let x2 = a1.get(0);
3456 expect.Expect.equals(9, x1);
3457 expect.Expect.equals(1, x2);
3458 for (let i = 0; i < dart.notNull(a1.length); i++)
3459 a1.set(i, 9);
3460 x1 = a1.get(4);
3461 a2.set(2, 1285);
3462 x2 = a1.get(4);
3463 expect.Expect.equals(9, x1);
3464 expect.Expect.equals(5, x2);
3465 for (let i = 0; i < dart.notNull(a1.length); i++)
3466 a1.set(i, 9);
3467 x1 = a1.get(3);
3468 a2.set(3, 1285);
3469 x2 = a1.get(3);
3470 expect.Expect.equals(9, x1);
3471 expect.Expect.equals(9, x2);
3472 for (let i = 0; i < dart.notNull(a1.length); i++)
3473 a1.set(i, 9);
3474 x1 = a1.get(2);
3475 a2.set(0, 1285);
3476 x2 = a1.get(2);
3477 expect.Expect.equals(9, x1);
3478 expect.Expect.equals(9, x2);
3479 }
3480 dart.fn(alias8x16);
3481 function main() {
3482 aliasWithByteData1();
3483 aliasWithByteData2();
3484 alias8x8();
3485 alias8x16();
3486 }
3487 dart.fn(main);
3488 // Exports:
3489 exports.aliasWithByteData1 = aliasWithByteData1;
3490 exports.aliasWithByteData2 = aliasWithByteData2;
3491 exports.alias8x8 = alias8x8;
3492 exports.alias8x16 = alias8x16;
3493 exports.main = main;
3494 });
3495 dart_library.library('lib/typed_data/typed_data_load_test', null, /* Imports */[
3496 'dart/_runtime',
3497 'dart/typed_data'
3498 ], /* Lazy imports */[
3499 ], function(exports, dart, typed_data) {
3500 'use strict';
3501 let dartx = dart.dartx;
3502 function main() {
3503 let list = typed_data.Int8List.new(1);
3504 list.set(0, 300);
3505 if (list.get(0) != 44) {
3506 dart.throw('Test failed');
3507 }
3508 let a = list.get(0);
3509 list.set(0, 0);
3510 if (list.get(0) != 0) {
3511 dart.throw('Test failed');
3512 }
3513 }
3514 dart.fn(main);
3515 // Exports:
3516 exports.main = main;
3517 });
3518 dart_library.library('lib/typed_data/typed_data_sublist_type_test', null, /* Imp orts */[
3519 'dart/_runtime',
3520 'dart/core',
3521 'expect/expect',
3522 'dart/typed_data'
3523 ], /* Lazy imports */[
3524 ], function(exports, dart, core, expect, typed_data) {
3525 'use strict';
3526 let dartx = dart.dartx;
3527 exports.inscrutable = null;
3528 const Is$ = dart.generic(function(T) {
3529 class Is extends core.Object {
3530 Is(name) {
3531 this.name = name;
3532 }
3533 check(x) {
3534 return dart.is(x, T);
3535 }
3536 expect(x, part) {
3537 expect.Expect.isTrue(this.check(x), `(${part}: ${dart.runtimeType(x)}) i s ${this.name}`);
3538 }
3539 expectNot(x, part) {
3540 expect.Expect.isFalse(this.check(x), `(${part}: ${dart.runtimeType(x)}) is! ${this.name}`);
3541 }
3542 }
3543 dart.setSignature(Is, {
3544 constructors: () => ({Is: [Is$(T), [dart.dynamic]]}),
3545 methods: () => ({
3546 check: [dart.dynamic, [dart.dynamic]],
3547 expect: [dart.dynamic, [dart.dynamic, dart.dynamic]],
3548 expectNot: [dart.dynamic, [dart.dynamic, dart.dynamic]]
3549 })
3550 });
3551 return Is;
3552 });
3553 let Is = Is$();
3554 function testSublistType(input, positive, all) {
3555 let negative = dart.dsend(all, 'where', dart.fn(check => !dart.notNull(dart. as(dart.dsend(positive, 'contains', check), core.bool)), core.bool, [dart.dynami c]));
3556 input = dart.dcall(exports.inscrutable, input);
3557 for (let check of dart.as(positive, core.Iterable))
3558 dart.dsend(check, 'expect', input, 'input');
3559 for (let check of dart.as(negative, core.Iterable))
3560 dart.dsend(check, 'expectNot', input, 'input');
3561 let sub = dart.dcall(exports.inscrutable, dart.dsend(input, 'sublist', 1));
3562 for (let check of dart.as(positive, core.Iterable))
3563 dart.dsend(check, 'expect', sub, 'sublist');
3564 for (let check of dart.as(negative, core.Iterable))
3565 dart.dsend(check, 'expectNot', sub, 'sublist');
3566 let sub2 = dart.dcall(exports.inscrutable, dart.dsend(input, 'sublist', 10)) ;
3567 expect.Expect.equals(0, dart.dload(sub2, 'length'));
3568 for (let check of dart.as(positive, core.Iterable))
3569 dart.dsend(check, 'expect', sub2, 'empty sublist');
3570 for (let check of dart.as(negative, core.Iterable))
3571 dart.dsend(check, 'expectNot', sub2, 'empty sublist');
3572 }
3573 dart.fn(testSublistType, dart.void, [dart.dynamic, dart.dynamic, dart.dynamic] );
3574 function testTypes() {
3575 let isFloat32list = new (Is$(typed_data.Float32List))('Float32List');
3576 let isFloat64list = new (Is$(typed_data.Float64List))('Float64List');
3577 let isInt8List = new (Is$(typed_data.Int8List))('Int8List');
3578 let isInt16List = new (Is$(typed_data.Int16List))('Int16List');
3579 let isInt32List = new (Is$(typed_data.Int32List))('Int32List');
3580 let isUint8List = new (Is$(typed_data.Uint8List))('Uint8List');
3581 let isUint16List = new (Is$(typed_data.Uint16List))('Uint16List');
3582 let isUint32List = new (Is$(typed_data.Uint32List))('Uint32List');
3583 let isUint8ClampedList = new (Is$(typed_data.Uint8ClampedList))('Uint8Clampe dList');
3584 let isIntList = new (Is$(core.List$(core.int)))('List<int>');
3585 let isDoubleList = new (Is$(core.List$(core.double)))('List<double>');
3586 let isNumList = new (Is$(core.List$(core.num)))('List<num>');
3587 let allChecks = [isFloat32list, isFloat64list, isInt8List, isInt16List, isIn t32List, isUint8List, isUint16List, isUint32List, isUint8ClampedList];
3588 function testInt(list, check) {
3589 testSublistType(list, [check, isIntList, isNumList], allChecks);
3590 }
3591 dart.fn(testInt);
3592 function testDouble(list, check) {
3593 testSublistType(list, [check, isDoubleList, isNumList], allChecks);
3594 }
3595 dart.fn(testDouble);
3596 testDouble(typed_data.Float32List.new(10), isFloat32list);
3597 testDouble(typed_data.Float64List.new(10), isFloat64list);
3598 testInt(typed_data.Int8List.new(10), isInt8List);
3599 testInt(typed_data.Int16List.new(10), isInt16List);
3600 testInt(typed_data.Int32List.new(10), isInt32List);
3601 testInt(typed_data.Uint8List.new(10), isUint8List);
3602 testInt(typed_data.Uint16List.new(10), isUint16List);
3603 testInt(typed_data.Uint32List.new(10), isUint32List);
3604 testInt(typed_data.Uint8ClampedList.new(10), isUint8ClampedList);
3605 }
3606 dart.fn(testTypes, dart.void, []);
3607 function main() {
3608 exports.inscrutable = dart.fn(x => x);
3609 testTypes();
3610 }
3611 dart.fn(main);
3612 // Exports:
3613 exports.Is$ = Is$;
3614 exports.Is = Is;
3615 exports.testSublistType = testSublistType;
3616 exports.testTypes = testTypes;
3617 exports.main = main;
3618 });
3619 dart_library.library('lib/typed_data/typed_list_iterable_test', null, /* Imports */[
3620 'dart/_runtime',
3621 'expect/expect',
3622 'dart/core',
3623 'dart/typed_data'
3624 ], /* Lazy imports */[
3625 ], function(exports, dart, expect, core, typed_data) {
3626 'use strict';
3627 let dartx = dart.dartx;
3628 function testIterableFunctions(list, first, last) {
3629 dart.assert(dart.dsend(dart.dload(list, 'length'), '>', 0));
3630 expect.Expect.equals(first, dart.dload(list, 'first'));
3631 expect.Expect.equals(last, dart.dload(list, 'last'));
3632 expect.Expect.equals(first, dart.dsend(list, 'firstWhere', dart.fn(x => dart .equals(x, first), core.bool, [dart.dynamic])));
3633 expect.Expect.equals(last, dart.dsend(list, 'lastWhere', dart.fn(x => dart.e quals(x, last), core.bool, [dart.dynamic])));
3634 if (dart.equals(dart.dload(list, 'length'), 1)) {
3635 expect.Expect.equals(first, dart.dload(list, 'single'));
3636 expect.Expect.equals(first, dart.dsend(list, 'singleWhere', dart.fn(x => d art.equals(x, last), core.bool, [dart.dynamic])));
3637 } else {
3638 expect.Expect.throws(dart.fn(() => dart.dload(list, 'single'), dart.void, []), dart.fn(e => dart.is(e, core.StateError), core.bool, [dart.dynamic]));
3639 let isFirst = true;
3640 expect.Expect.equals(first, dart.dsend(list, 'singleWhere', dart.fn(x => {
3641 if (isFirst) {
3642 isFirst = false;
3643 return true;
3644 }
3645 return false;
3646 })));
3647 }
3648 expect.Expect.isFalse(dart.dload(list, 'isEmpty'));
3649 let i = 0;
3650 for (let x of dart.as(list, core.Iterable)) {
3651 expect.Expect.equals(dart.dindex(list, i++), x);
3652 }
3653 expect.Expect.isTrue(dart.dsend(list, 'any', dart.fn(x => dart.equals(x, las t), core.bool, [dart.dynamic])));
3654 expect.Expect.isFalse(dart.dsend(list, 'any', dart.fn(x => false, core.bool, [dart.dynamic])));
3655 expect.Expect.isTrue(dart.dsend(list, 'contains', last));
3656 expect.Expect.equals(first, dart.dsend(list, 'elementAt', 0));
3657 expect.Expect.isTrue(dart.dsend(list, 'every', dart.fn(x => true, core.bool, [dart.dynamic])));
3658 expect.Expect.isFalse(dart.dsend(list, 'every', dart.fn(x => !dart.equals(x, last), core.bool, [dart.dynamic])));
3659 expect.Expect.listEquals([], dart.as(dart.dsend(dart.dsend(list, 'expand', d art.fn(x => [], core.List, [dart.dynamic])), 'toList'), core.List));
3660 let expand2 = dart.dsend(list, 'expand', dart.fn(x => [x, x], core.List, [da rt.dynamic]));
3661 i = 0;
3662 for (let x of dart.as(expand2, core.Iterable)) {
3663 expect.Expect.equals(dart.dindex(list, (i / 2)[dartx.truncate]()), x);
3664 i++;
3665 }
3666 expect.Expect.equals(2 * dart.notNull(dart.as(dart.dload(list, 'length'), co re.num)), i);
3667 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(list, 'fold', [], dart.fn((result, x) => ((() => {
3668 dart.dsend(result, 'add', x);
3669 return result;
3670 })()))), core.List));
3671 i = 0;
3672 dart.dsend(list, 'forEach', dart.fn(x => {
3673 expect.Expect.equals(dart.dindex(list, i++), x);
3674 }));
3675 expect.Expect.equals(dart.dsend(dart.dsend(list, 'toList'), 'join', "*"), da rt.dsend(list, 'join', "*"));
3676 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'map', dart.fn(x => x)), 'toList'), core.List));
3677 let mapCount = 0;
3678 let mappedList = dart.dsend(list, 'map', dart.fn(x => {
3679 mapCount++;
3680 return x;
3681 }));
3682 expect.Expect.equals(0, mapCount);
3683 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(mappedList, 'len gth'));
3684 expect.Expect.equals(0, mapCount);
3685 dart.dsend(mappedList, 'join');
3686 expect.Expect.equals(dart.dload(list, 'length'), mapCount);
3687 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'where', dart.fn(x => true, core.bool, [dart.dynamic])), 'toList'), c ore.List));
3688 let whereCount = 0;
3689 let whereList = dart.dsend(list, 'where', dart.fn(x => {
3690 whereCount++;
3691 return true;
3692 }));
3693 expect.Expect.equals(0, whereCount);
3694 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(whereList, 'leng th'));
3695 expect.Expect.equals(dart.dload(list, 'length'), whereCount);
3696 if (dart.notNull(dart.as(dart.dsend(dart.dload(list, 'length'), '>', 1), cor e.bool))) {
3697 let reduceResult = 1;
3698 expect.Expect.equals(dart.dload(list, 'length'), dart.dsend(list, 'reduce' , dart.fn((x, y) => ++reduceResult, core.int, [dart.dynamic, dart.dynamic])));
3699 } else {
3700 expect.Expect.equals(first, dart.dsend(list, 'reduce', dart.fn((x, y) => {
3701 dart.throw("should not be called");
3702 })));
3703 }
3704 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skip', dart.dload(list, 'l ength')), 'isEmpty'));
3705 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'skip', 0), 'toList'), core.List));
3706 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skipWhile', dart.fn(x => t rue, core.bool, [dart.dynamic])), 'isEmpty'));
3707 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'skipWhile', dart.fn(x => false, core.bool, [dart.dynamic])), 'toList '), core.List));
3708 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'take', dart.dload(list, 'length')), 'toList'), core.List));
3709 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'take', 0), 'isEmpty'));
3710 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'takeWhile', dart.fn(x => f alse, core.bool, [dart.dynamic])), 'isEmpty'));
3711 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'takeWhile', dart.fn(x => true, core.bool, [dart.dynamic])), 'toList' ), core.List));
3712 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'toList'), 'toList'), core.List));
3713 let l2 = dart.dsend(list, 'toList');
3714 dart.dsend(l2, 'add', first);
3715 expect.Expect.equals(first, dart.dload(l2, 'last'));
3716 let l3 = dart.dsend(list, 'toList', {growable: false});
3717 expect.Expect.throws(dart.fn(() => dart.dsend(l3, 'add', last), dart.void, [ ]), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3718 }
3719 dart.fn(testIterableFunctions, dart.void, [dart.dynamic, dart.dynamic, dart.dy namic]);
3720 function emptyChecks(list) {
3721 dart.assert(dart.equals(dart.dload(list, 'length'), 0));
3722 expect.Expect.isTrue(dart.dload(list, 'isEmpty'));
3723 expect.Expect.throws(dart.fn(() => dart.dload(list, 'first'), dart.void, []) , dart.fn(e => dart.is(e, core.StateError), core.bool, [dart.dynamic]));
3724 expect.Expect.throws(dart.fn(() => dart.dload(list, 'last'), dart.void, []), dart.fn(e => dart.is(e, core.StateError), core.bool, [dart.dynamic]));
3725 expect.Expect.throws(dart.fn(() => dart.dload(list, 'single'), dart.void, [] ), dart.fn(e => dart.is(e, core.StateError), core.bool, [dart.dynamic]));
3726 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'firstWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, co re.StateError), core.bool, [dart.dynamic]));
3727 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'lastWhere', dart.fn(x = > true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, cor e.StateError), core.bool, [dart.dynamic]));
3728 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'singleWhere', dart.fn(x => true, core.bool, [dart.dynamic])), dart.void, []), dart.fn(e => dart.is(e, c ore.StateError), core.bool, [dart.dynamic]));
3729 expect.Expect.isFalse(dart.dsend(list, 'any', dart.fn(x => true, core.bool, [dart.dynamic])));
3730 expect.Expect.isFalse(dart.dsend(list, 'contains', null));
3731 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'elementAt', 0), dart.vo id, []), dart.fn(e => dart.is(e, core.RangeError), core.bool, [dart.dynamic]));
3732 expect.Expect.isTrue(dart.dsend(list, 'every', dart.fn(x => false, core.bool , [dart.dynamic])));
3733 expect.Expect.listEquals([], dart.as(dart.dsend(dart.dsend(list, 'expand', d art.fn(x => [], core.List, [dart.dynamic])), 'toList'), core.List));
3734 expect.Expect.listEquals([], dart.as(dart.dsend(dart.dsend(list, 'expand', d art.fn(x => [x, x], core.List, [dart.dynamic])), 'toList'), core.List));
3735 expect.Expect.listEquals([], dart.as(dart.dsend(dart.dsend(list, 'expand', d art.fn(x => {
3736 dart.throw("should not be reached");
3737 })), 'toList'), core.List));
3738 expect.Expect.listEquals([], dart.as(dart.dsend(list, 'fold', [], dart.fn((r esult, x) => ((() => {
3739 dart.dsend(result, 'add', x);
3740 return result;
3741 })()))), core.List));
3742 expect.Expect.equals(dart.dsend(dart.dsend(list, 'toList'), 'join', "*"), da rt.dsend(list, 'join', "*"));
3743 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'map', dart.fn(x => x)), 'toList'), core.List));
3744 let mapCount = 0;
3745 let mappedList = dart.dsend(list, 'map', dart.fn(x => {
3746 mapCount++;
3747 return x;
3748 }));
3749 expect.Expect.equals(0, mapCount);
3750 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(mappedList, 'len gth'));
3751 expect.Expect.equals(0, mapCount);
3752 dart.dsend(mappedList, 'join');
3753 expect.Expect.equals(dart.dload(list, 'length'), mapCount);
3754 expect.Expect.listEquals(dart.as(list, core.List), dart.as(dart.dsend(dart.d send(list, 'where', dart.fn(x => true, core.bool, [dart.dynamic])), 'toList'), c ore.List));
3755 let whereCount = 0;
3756 let whereList = dart.dsend(list, 'where', dart.fn(x => {
3757 whereCount++;
3758 return true;
3759 }));
3760 expect.Expect.equals(0, whereCount);
3761 expect.Expect.equals(dart.dload(list, 'length'), dart.dload(whereList, 'leng th'));
3762 expect.Expect.equals(dart.dload(list, 'length'), whereCount);
3763 expect.Expect.throws(dart.fn(() => dart.dsend(list, 'reduce', dart.fn((x, y) => x)), dart.void, []), dart.fn(e => dart.is(e, core.StateError), core.bool, [d art.dynamic]));
3764 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skip', dart.dload(list, 'l ength')), 'isEmpty'));
3765 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skip', 0), 'isEmpty'));
3766 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skipWhile', dart.fn(x => t rue, core.bool, [dart.dynamic])), 'isEmpty'));
3767 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'skipWhile', dart.fn(x => f alse, core.bool, [dart.dynamic])), 'isEmpty'));
3768 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'take', dart.dload(list, 'l ength')), 'isEmpty'));
3769 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'take', 0), 'isEmpty'));
3770 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'takeWhile', dart.fn(x => f alse, core.bool, [dart.dynamic])), 'isEmpty'));
3771 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'takeWhile', dart.fn(x => t rue, core.bool, [dart.dynamic])), 'isEmpty'));
3772 expect.Expect.isTrue(dart.dload(dart.dsend(list, 'toList'), 'isEmpty'));
3773 let l2 = dart.dsend(list, 'toList');
3774 dart.dsend(l2, 'add', 0);
3775 expect.Expect.equals(0, dart.dload(l2, 'last'));
3776 let l3 = dart.dsend(list, 'toList', {growable: false});
3777 expect.Expect.throws(dart.fn(() => dart.dsend(l3, 'add', 0), dart.void, []), dart.fn(e => dart.is(e, core.UnsupportedError), core.bool, [dart.dynamic]));
3778 }
3779 dart.fn(emptyChecks, dart.void, [dart.dynamic]);
3780 function main() {
3781 testIterableFunctions(typed_data.Float32List.fromList(dart.list([1.5, 9.5], core.double)), 1.5, 9.5);
3782 testIterableFunctions(typed_data.Float64List.fromList(dart.list([1.5, 9.5], core.double)), 1.5, 9.5);
3783 testIterableFunctions(typed_data.Int8List.fromList(dart.list([3, 9], core.in t)), 3, 9);
3784 testIterableFunctions(typed_data.Int16List.fromList(dart.list([3, 9], core.i nt)), 3, 9);
3785 testIterableFunctions(typed_data.Int32List.fromList(dart.list([3, 9], core.i nt)), 3, 9);
3786 testIterableFunctions(typed_data.Uint8List.fromList(dart.list([3, 9], core.i nt)), 3, 9);
3787 testIterableFunctions(typed_data.Uint16List.fromList(dart.list([3, 9], core. int)), 3, 9);
3788 testIterableFunctions(typed_data.Uint32List.fromList(dart.list([3, 9], core. int)), 3, 9);
3789 emptyChecks(typed_data.Float32List.new(0));
3790 emptyChecks(typed_data.Float64List.new(0));
3791 emptyChecks(typed_data.Int8List.new(0));
3792 emptyChecks(typed_data.Int16List.new(0));
3793 emptyChecks(typed_data.Int32List.new(0));
3794 emptyChecks(typed_data.Uint8List.new(0));
3795 emptyChecks(typed_data.Uint16List.new(0));
3796 emptyChecks(typed_data.Uint32List.new(0));
3797 }
3798 dart.fn(main);
3799 // Exports:
3800 exports.testIterableFunctions = testIterableFunctions;
3801 exports.emptyChecks = emptyChecks;
3802 exports.main = main;
3803 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698