Index: test/mjsunit/simd/prototype.js |
diff --git a/test/mjsunit/compiler/regress-const.js b/test/mjsunit/simd/prototype.js |
similarity index 67% |
copy from test/mjsunit/compiler/regress-const.js |
copy to test/mjsunit/simd/prototype.js |
index aa55d0fd3ae17051a084a6bf28c2257f2abc8495..adc4d5058c96d0c2dd383cccf285527a5f1e5c93 100644 |
--- a/test/mjsunit/compiler/regress-const.js |
+++ b/test/mjsunit/simd/prototype.js |
@@ -25,44 +25,32 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
- |
-// Test const initialization and assignments. |
-function f() { |
- var x = 42; |
- while (true) { |
- const y = x; |
- if (--x == 0) return y; |
- } |
-} |
- |
-function g() { |
- const x = 42; |
- x += 1; |
- return x; |
-} |
- |
-for (var i = 0; i < 5; i++) { |
- f(); |
- g(); |
+// Flags: --simd_object --allow-natives-syntax |
+ |
+function testFloat32x4Prototype() { |
+ var a4 = float32x4(1.0, -2.0, 3.0, -4.0); |
+ float32x4.prototype = {}; |
+ assertEquals(undefined, a4.x); |
+ assertEquals(undefined, a4.y); |
+ assertEquals(undefined, a4.z); |
+ assertEquals(undefined, a4.w); |
} |
-%OptimizeFunctionOnNextCall(f); |
-%OptimizeFunctionOnNextCall(g); |
- |
-assertEquals(42, f()); |
-assertEquals(42, g()); |
- |
- |
-function h(a, b) { |
- var r = a + b; |
- const X = 42; |
- return r + X; |
+testFloat32x4Prototype(); |
+testFloat32x4Prototype(); |
+%OptimizeFunctionOnNextCall(testFloat32x4Prototype); |
+testFloat32x4Prototype(); |
+ |
+function testInt32x4Prototype() { |
+ var a4 = int32x4(1.0, -2.0, 3.0, -4.0); |
+ int32x4.prototype = {}; |
+ assertEquals(undefined, a4.x); |
+ assertEquals(undefined, a4.y); |
+ assertEquals(undefined, a4.z); |
+ assertEquals(undefined, a4.w); |
} |
-for (var i = 0; i < 5; i++) h(1,2); |
- |
-%OptimizeFunctionOnNextCall(h); |
- |
-assertEquals(45, h(1,2)); |
-assertEquals("foo742", h("foo", 7)); |
+testInt32x4Prototype(); |
+testInt32x4Prototype(); |
+%OptimizeFunctionOnNextCall(testInt32x4Prototype); |
+testInt32x4Prototype(); |