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

Unified Diff: test/codegen/expect/lib/typed_data/int32x4_shuffle_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: test/codegen/expect/lib/typed_data/int32x4_shuffle_test.js
diff --git a/test/codegen/expect/lib/typed_data/int32x4_shuffle_test.js b/test/codegen/expect/lib/typed_data/int32x4_shuffle_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..2c6e7e2b68aa11f0ea81ab922d85ff46692a505d
--- /dev/null
+++ b/test/codegen/expect/lib/typed_data/int32x4_shuffle_test.js
@@ -0,0 +1,66 @@
+dart_library.library('lib/typed_data/int32x4_shuffle_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__int32x4_shuffle_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const typed_data = dart_sdk.typed_data;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const int32x4_shuffle_test = Object.create(null);
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ int32x4_shuffle_test.testShuffle = function() {
+ let m = typed_data.Int32x4.new(1, 2, 3, 4);
+ let c = null;
+ c = m.shuffle(typed_data.Int32x4.WZYX);
+ expect$.Expect.equals(4, dart.dload(c, 'x'));
+ expect$.Expect.equals(3, dart.dload(c, 'y'));
+ expect$.Expect.equals(2, dart.dload(c, 'z'));
+ expect$.Expect.equals(1, dart.dload(c, 'w'));
+ };
+ dart.fn(int32x4_shuffle_test.testShuffle, VoidTovoid());
+ int32x4_shuffle_test.testShuffleNonConstant = function(mask) {
+ let m = typed_data.Int32x4.new(1, 2, 3, 4);
+ let c = null;
+ c = m.shuffle(core.int._check(mask));
+ if (dart.equals(mask, 1)) {
+ expect$.Expect.equals(2, dart.dload(c, 'x'));
+ expect$.Expect.equals(1, dart.dload(c, 'y'));
+ expect$.Expect.equals(1, dart.dload(c, 'z'));
+ expect$.Expect.equals(1, dart.dload(c, 'w'));
+ } else {
+ expect$.Expect.equals(dart.notNull(typed_data.Int32x4.YYYY) + 1, mask);
+ expect$.Expect.equals(3, dart.dload(c, 'x'));
+ expect$.Expect.equals(2, dart.dload(c, 'y'));
+ expect$.Expect.equals(2, dart.dload(c, 'z'));
+ expect$.Expect.equals(2, dart.dload(c, 'w'));
+ }
+ };
+ dart.fn(int32x4_shuffle_test.testShuffleNonConstant, dynamicTovoid());
+ int32x4_shuffle_test.testShuffleMix = function() {
+ let m = typed_data.Int32x4.new(1, 2, 3, 4);
+ let n = typed_data.Int32x4.new(5, 6, 7, 8);
+ let c = m.shuffleMix(n, typed_data.Int32x4.XYXY);
+ expect$.Expect.equals(1, c.x);
+ expect$.Expect.equals(2, c.y);
+ expect$.Expect.equals(5, c.z);
+ expect$.Expect.equals(6, c.w);
+ };
+ dart.fn(int32x4_shuffle_test.testShuffleMix, VoidTovoid());
+ int32x4_shuffle_test.main = function() {
+ let xxxx = dart.notNull(typed_data.Int32x4.XXXX) + 1;
+ let yyyy = dart.notNull(typed_data.Int32x4.YYYY) + 1;
+ for (let i = 0; i < 20; i++) {
+ int32x4_shuffle_test.testShuffle();
+ int32x4_shuffle_test.testShuffleNonConstant(xxxx);
+ int32x4_shuffle_test.testShuffleNonConstant(yyyy);
+ int32x4_shuffle_test.testShuffleMix();
+ }
+ };
+ dart.fn(int32x4_shuffle_test.main, VoidTodynamic());
+ // Exports:
+ exports.int32x4_shuffle_test = int32x4_shuffle_test;
+});
« no previous file with comments | « test/codegen/expect/lib/typed_data/int32x4_list_test.js ('k') | test/codegen/expect/lib/typed_data/int32x4_sign_mask_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698