NASHORN-609.js revision 2:da1e581c933b
151974Smsmith/*
265245Smsmith * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
365245Smsmith * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
451974Smsmith *
551974Smsmith * This code is free software; you can redistribute it and/or modify it
651974Smsmith * under the terms of the GNU General Public License version 2 only, as
751974Smsmith * published by the Free Software Foundation.
851974Smsmith *
951974Smsmith * This code is distributed in the hope that it will be useful, but WITHOUT
1051974Smsmith * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1151974Smsmith * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1251974Smsmith * version 2 for more details (a copy is included in the LICENSE file that
1351974Smsmith * accompanied this code).
1451974Smsmith *
1551974Smsmith * You should have received a copy of the GNU General Public License version
1651974Smsmith * 2 along with this work; if not, write to the Free Software Foundation,
1751974Smsmith * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1851974Smsmith *
1951974Smsmith * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2051974Smsmith * or visit www.oracle.com if you need additional information or have any
2151974Smsmith * questions.
2251974Smsmith */
2351974Smsmith
2451974Smsmith/*
2551974Smsmith * NASHORN-609: ASSIGN_SHR result is converted to INT (should be UINT32).
26119418Sobrien *
27139749Simp * @test
28106225Semoore * @run
29140688Sscottl */
30106225Semoorefunction test() {
31106225Semoore    var shr = -1;
32106225Semoore    print(shr >>>= 0, shr);
33106225Semoore    var shr2 = 0xffffffff;
34106225Semoore    print(shr2 >>>= 0, shr2);
35106225Semoore    var shr3 = "-1";
36106225Semoore    print(shr3 >>>= 0, shr3);
37106225Semoore    var shr4 = -1.5;
38106225Semoore    print(shr4 >>>= 0, shr4);
39106225Semoore    var shr5 = 0xffffffffff;
40105419Semoore    print(shr5 >>>= 0, shr5);
41106225Semoore}
42105419Semooretest();
43105419Semoore
44106225Semoore