Mercurial > hg > graal-compiler
comparison test/compiler/7052494/Test7052494.java @ 3807: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 | aacaff365100 |
children |
comparison
equal
deleted
inserted
replaced
3806:1f4f4ae84625 | 3807:3fbb609d9e96 |
---|---|
68 arr[arr.length + i] = i*2; | 68 arr[arr.length + i] = i*2; |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 // Empty loop rolls through MAXINT if i > 0 | 72 // Empty loop rolls through MAXINT if i > 0 |
73 | |
74 static final int limit5 = Integer.MIN_VALUE + 10000; | |
75 | |
73 static int test5(int i) { | 76 static int test5(int i) { |
74 int result = 0; | 77 int result = 0; |
75 while (i++ != 0) { | 78 while (i++ != limit5) { |
76 result = i*2; | 79 result = i*2; |
77 } | 80 } |
78 return result; | 81 return result; |
79 } | 82 } |
80 | 83 |
81 // Empty loop rolls through MININT if i < 0 | 84 // Empty loop rolls through MININT if i < 0 |
85 | |
86 static final int limit6 = Integer.MAX_VALUE - 10000; | |
87 | |
82 static int test6(int i) { | 88 static int test6(int i) { |
83 int result = 0; | 89 int result = 0; |
84 while (i-- != 0) { | 90 while (i-- != limit6) { |
85 result = i*2; | 91 result = i*2; |
86 } | 92 } |
87 return result; | 93 return result; |
88 } | 94 } |
89 | 95 |
90 public static void main(String [] args) { | 96 public static void main(String [] args) { |
91 boolean failed = false; | 97 boolean failed = false; |
92 int[] arr = new int[8]; | 98 int[] arr = new int[8]; |
93 int[] ar3 = { 0, 0, 4, 6, 8, 10, 0, 0 }; | 99 int[] ar3 = { 0, 0, 4, 6, 8, 10, 0, 0 }; |
94 int[] ar4 = { 0, 0, 0, -10, -8, -6, -4, 0 }; | 100 int[] ar4 = { 0, 0, 0, -10, -8, -6, -4, 0 }; |
101 System.out.println("test1"); | |
95 for (int i = 0; i < 11000; i++) { | 102 for (int i = 0; i < 11000; i++) { |
96 int k = test1(1, 10); | 103 int k = test1(1, 10); |
97 if (k != 10) { | 104 if (k != 10) { |
98 System.out.println("FAILED: " + k + " != 10"); | 105 System.out.println("FAILED: " + k + " != 10"); |
99 failed = true; | 106 failed = true; |
100 break; | 107 break; |
101 } | 108 } |
102 } | 109 } |
110 System.out.println("test2"); | |
103 for (int i = 0; i < 11000; i++) { | 111 for (int i = 0; i < 11000; i++) { |
104 int k = test2(-1, -10); | 112 int k = test2(-1, -10); |
105 if (k != -10) { | 113 if (k != -10) { |
106 System.out.println("FAILED: " + k + " != -10"); | 114 System.out.println("FAILED: " + k + " != -10"); |
107 failed = true; | 115 failed = true; |
108 break; | 116 break; |
109 } | 117 } |
110 } | 118 } |
119 System.out.println("test3"); | |
111 for (int i = 0; i < 11000; i++) { | 120 for (int i = 0; i < 11000; i++) { |
112 java.util.Arrays.fill(arr, 0); | 121 java.util.Arrays.fill(arr, 0); |
113 test3(1, 10, arr); | 122 test3(1, 10, arr); |
114 if (!java.util.Arrays.equals(arr,ar3)) { | 123 if (!java.util.Arrays.equals(arr,ar3)) { |
115 System.out.println("FAILED: arr = { " + arr[0] + ", " | 124 System.out.println("FAILED: arr = { " + arr[0] + ", " |
122 + arr[7] + " }"); | 131 + arr[7] + " }"); |
123 failed = true; | 132 failed = true; |
124 break; | 133 break; |
125 } | 134 } |
126 } | 135 } |
136 System.out.println("test4"); | |
127 for (int i = 0; i < 11000; i++) { | 137 for (int i = 0; i < 11000; i++) { |
128 java.util.Arrays.fill(arr, 0); | 138 java.util.Arrays.fill(arr, 0); |
129 test4(-1, -10, arr); | 139 test4(-1, -10, arr); |
130 if (!java.util.Arrays.equals(arr,ar4)) { | 140 if (!java.util.Arrays.equals(arr,ar4)) { |
131 System.out.println("FAILED: arr = { " + arr[0] + ", " | 141 System.out.println("FAILED: arr = { " + arr[0] + ", " |
138 + arr[7] + " }"); | 148 + arr[7] + " }"); |
139 failed = true; | 149 failed = true; |
140 break; | 150 break; |
141 } | 151 } |
142 } | 152 } |
153 System.out.println("test5"); | |
143 for (int i = 0; i < 11000; i++) { | 154 for (int i = 0; i < 11000; i++) { |
144 int k = test5(1); | 155 int k = test5(limit6); |
145 if (k != 0) { | 156 if (k != limit5*2) { |
146 System.out.println("FAILED: " + k + " != 0"); | 157 System.out.println("FAILED: " + k + " != " + limit5*2); |
147 failed = true; | 158 failed = true; |
148 break; | 159 break; |
149 } | 160 } |
150 } | 161 } |
162 System.out.println("test6"); | |
151 for (int i = 0; i < 11000; i++) { | 163 for (int i = 0; i < 11000; i++) { |
152 int k = test6(-1); | 164 int k = test6(limit5); |
153 if (k != 0) { | 165 if (k != limit6*2) { |
154 System.out.println("FAILED: " + k + " != 0"); | 166 System.out.println("FAILED: " + k + " != " + limit6*2); |
155 failed = true; | 167 failed = true; |
156 break; | 168 break; |
157 } | 169 } |
158 } | 170 } |
171 System.out.println("finish"); | |
159 if (failed) | 172 if (failed) |
160 System.exit(97); | 173 System.exit(97); |
161 } | 174 } |
162 } | 175 } |