changeset 2569:3fbb609d9e96

7067288: compiler regression test Test7052494 timeouts with client VM Summary: Test is modified to reduce number of iterations in test5() and test6(). Reviewed-by: never, iveresov
author kvn
date Thu, 14 Jul 2011 15:39:40 -0700
parents 1f4f4ae84625
children 341a57af9b0a
files test/compiler/7052494/Test7052494.java
diffstat 1 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/7052494/Test7052494.java	Wed Jul 13 10:48:42 2011 -0700
+++ b/test/compiler/7052494/Test7052494.java	Thu Jul 14 15:39:40 2011 -0700
@@ -70,18 +70,24 @@
   }
 
   // Empty loop rolls through MAXINT if i > 0
+
+  static final int limit5 = Integer.MIN_VALUE + 10000;
+
   static int test5(int i) {
     int result = 0;
-    while (i++ != 0) {
+    while (i++ != limit5) {
       result = i*2;
     }
     return result;
   }
 
   // Empty loop rolls through MININT if i < 0
+
+  static final int limit6 = Integer.MAX_VALUE - 10000;
+
   static int test6(int i) {
     int result = 0;
-    while (i-- != 0) {
+    while (i-- != limit6) {
       result = i*2;
     }
     return result;
@@ -92,6 +98,7 @@
     int[] arr = new int[8];
     int[] ar3 = { 0, 0, 4, 6, 8, 10, 0, 0 };
     int[] ar4 = { 0, 0, 0, -10, -8, -6, -4, 0 };
+    System.out.println("test1");
     for (int i = 0; i < 11000; i++) {
       int k = test1(1, 10);
       if (k != 10) {
@@ -100,6 +107,7 @@
         break;
       }
     }
+    System.out.println("test2");
     for (int i = 0; i < 11000; i++) {
       int k = test2(-1, -10);
       if (k != -10) {
@@ -108,6 +116,7 @@
         break;
       }
     }
+    System.out.println("test3");
     for (int i = 0; i < 11000; i++) {
       java.util.Arrays.fill(arr, 0);
       test3(1, 10, arr);
@@ -124,6 +133,7 @@
         break;
       }
     }
+    System.out.println("test4");
     for (int i = 0; i < 11000; i++) {
       java.util.Arrays.fill(arr, 0);
       test4(-1, -10, arr);
@@ -140,22 +150,25 @@
         break;
       }
     }
+    System.out.println("test5");
     for (int i = 0; i < 11000; i++) {
-      int k = test5(1);
-      if (k != 0) {
-        System.out.println("FAILED: " + k + " != 0");
+      int k = test5(limit6);
+      if (k != limit5*2) {
+        System.out.println("FAILED: " + k + " != " + limit5*2);
         failed = true;
         break;
       }
     }
+    System.out.println("test6");
     for (int i = 0; i < 11000; i++) {
-      int k = test6(-1);
-      if (k != 0) {
-        System.out.println("FAILED: " + k + " != 0");
+      int k = test6(limit5);
+      if (k != limit6*2) {
+        System.out.println("FAILED: " + k + " != " + limit6*2);
         failed = true;
         break;
       }
     }
+    System.out.println("finish");
     if (failed)
       System.exit(97);
   }