summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/TypedObject/jit-read-u32-from-u32-array.js
blob: 5c2906c41919911dfdeab83b85c8b2271d4416d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/
 */

if (!this.hasOwnProperty("TypedObject"))
  quit();

var Vec3u32Type = TypedObject.uint32.array(3);

function foo_u32() {
  for (var i = 0; i < 30000; i += 3) {
    var vec = new Vec3u32Type([i, i+1, i+2]);
    var sum = vec[0] + vec[1] + vec[2];
    assertEq(sum, 3*i + 3);
  }
}

foo_u32();