2507N/A/*
2507N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2507N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2507N/A *
2507N/A * This code is free software; you can redistribute it and/or modify it
2507N/A * under the terms of the GNU General Public License version 2 only, as
2507N/A * published by the Free Software Foundation.
2507N/A *
2507N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2507N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2507N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2507N/A * version 2 for more details (a copy is included in the LICENSE file that
2507N/A * accompanied this code).
2507N/A *
2507N/A * You should have received a copy of the GNU General Public License version
2507N/A * 2 along with this work; if not, write to the Free Software Foundation,
2507N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2507N/A *
2507N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2507N/A * or visit www.oracle.com if you need additional information or have any
2507N/A * questions.
2507N/A *
2507N/A */
2507N/A
2507N/A/**
2507N/A * @test
2507N/A * @bug 7048332
2507N/A * @summary Cadd_cmpLTMask doesn't handle 64-bit tmp register properly
2507N/A *
2507N/A * @run main/othervm -Xbatch Test7048332
2507N/A */
2507N/A
2507N/A
2507N/Apublic class Test7048332 {
2507N/A
2507N/A static int capacity = 2;
2507N/A static int first = 1;
2507N/A static int last = 2;
2507N/A
2507N/A static int test(int i1, int i2, int i3, int i4, int i5, int i6) {
2507N/A final int result;
2507N/A if (last >= first) {
2507N/A result = last - first;
2507N/A } else {
2507N/A result = last - first + capacity;
2507N/A }
2507N/A return result;
2507N/A }
2507N/A
2507N/A public static void main(String [] args) {
2507N/A for (int i = 0; i < 11000; i++) {
2507N/A last = (i & 1) << 1; // 0 or 2
2507N/A int k = test(1, 2, 3, 4, 5, 6);
2507N/A if (k != 1) {
2507N/A System.out.println("FAILED: " + k + " != 1");
2507N/A System.exit(97);
2507N/A }
2507N/A }
2507N/A }
2507N/A}