test/script/basic/JDK-8170594.js

Fri, 14 Jul 2017 14:30:06 -0700

author
asaha
date
Fri, 14 Jul 2017 14:30:06 -0700
changeset 2184
e474dc29c216
parent 1981
00ab24e0ebc5
permissions
-rw-r--r--

Merge

attila@1981 1 /*
attila@1981 2 * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
attila@1981 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@1981 4 *
attila@1981 5 * This code is free software; you can redistribute it and/or modify it
attila@1981 6 * under the terms of the GNU General Public License version 2 only, as
attila@1981 7 * published by the Free Software Foundation.
attila@1981 8 *
attila@1981 9 * This code is distributed in the hope that it will be useful, but WITHOUT
attila@1981 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
attila@1981 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
attila@1981 12 * version 2 for more details (a copy is included in the LICENSE file that
attila@1981 13 * accompanied this code).
attila@1981 14 *
attila@1981 15 * You should have received a copy of the GNU General Public License version
attila@1981 16 * 2 along with this work; if not, write to the Free Software Foundation,
attila@1981 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@1981 18 *
attila@1981 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
attila@1981 20 * or visit www.oracle.com if you need additional information or have any
attila@1981 21 * questions.
attila@1981 22 */
attila@1981 23
attila@1981 24 /**
attila@1981 25 * JDK-8170594: >>>=0 generates invalid bytecode for BaseNode LHS
attila@1981 26 *
attila@1981 27 * @test
attila@1981 28 * @run
attila@1981 29 */
attila@1981 30
attila@1981 31 var obj1 = {x: "100"};
attila@1981 32 (function (o, p) {
attila@1981 33 if (p) {
attila@1981 34 o.x >>>= 0;
attila@1981 35 }
attila@1981 36 })(obj1, true)
attila@1981 37 Assert.assertTrue(obj1.x === 100)
attila@1981 38
attila@1981 39 var obj2 = ["100"];
attila@1981 40 (function (o, p) {
attila@1981 41 if (p) {
attila@1981 42 o[0] >>>= 0;
attila@1981 43 }
attila@1981 44 })(obj2, true)
attila@1981 45 Assert.assertTrue(obj2[0] === 100)

mercurial