10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 5091921
28 * @summary Sign flip issues in loop optimizer
29 *
30 * @run main/othervm -Xcomp -XX:CompileOnly=Test5091921 -XX:MaxInlineSize=1 Test5091921
31 */
32
33 public class Test5091921 {
34 private static int result = 0;
35
36
37 /* Test for the bug of transforming indx >= MININT to indx > MININT-1 */
38 public static int test_ge1(int limit) {
39 int indx;
40 int sum = 0;
41 for (indx = 500; indx >= limit; indx -= 2) {
42 sum += 2000 / indx;
43 result = sum;
44 }
45 return sum;
46 }
47
48 /* Test for the bug of transforming indx <= MAXINT to indx < MAXINT+1 */
49 public static int test_le1(int limit) {
50 int indx;
51 int sum = 0;
52 for (indx = -500; indx <= limit; indx += 2)
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 5091921
28 * @summary Sign flip issues in loop optimizer
29 *
30 * @run main/othervm -Xcomp -XX:MaxInlineSize=1
31 * -XX:CompileCommand=compileonly,compiler.c2.Test5091921::*
32 * compiler.c2.Test5091921
33 */
34
35 package compiler.c2;
36
37 public class Test5091921 {
38 private static int result = 0;
39
40
41 /* Test for the bug of transforming indx >= MININT to indx > MININT-1 */
42 public static int test_ge1(int limit) {
43 int indx;
44 int sum = 0;
45 for (indx = 500; indx >= limit; indx -= 2) {
46 sum += 2000 / indx;
47 result = sum;
48 }
49 return sum;
50 }
51
52 /* Test for the bug of transforming indx <= MAXINT to indx < MAXINT+1 */
53 public static int test_le1(int limit) {
54 int indx;
55 int sum = 0;
56 for (indx = -500; indx <= limit; indx += 2)
|