summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/TypedObject/jit-read-float64.js
blob: 4a766b41fc183b3ef6b77fbb3d4e318250f0de14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if (!this.hasOwnProperty("TypedObject"))
  quit();

var PointType = new TypedObject.StructType({x: TypedObject.float64,
                                            y: TypedObject.float64,
                                            z: TypedObject.float64});

function foo() {
  for (var i = 0; i < 30000; i += 3) {
    var pt = new PointType({x: i, y: i+1, z: i+2});
    var sum = pt.x + pt.y + pt.z;
    print(pt.x, pt.y, pt.z);
    assertEq(sum, 3*i + 3);
  }
}

foo();