1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/compiler/6934604/TestDoubleBoxing.java Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,777 @@ 1.4 +/* 1.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + */ 1.26 + 1.27 +/* 1.28 + * @test 1.29 + * @bug 6934604 1.30 + * @summary enable parts of EliminateAutoBox by default 1.31 + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestDoubleBoxing 1.32 + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox 1.33 + * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing 1.34 + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox 1.35 + * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing 1.36 + * 1.37 + */ 1.38 + 1.39 +public class TestDoubleBoxing { 1.40 + 1.41 + static final Double ibc = new Double(1.); 1.42 + 1.43 + //=============================================== 1.44 + // Non-inlined methods to test deoptimization info 1.45 + static void dummy() { } 1.46 + static double foo(double i) { return i; } 1.47 + static Double foob(double i) { return Double.valueOf(i); } 1.48 + 1.49 + 1.50 + static double simple(double i) { 1.51 + Double ib = new Double(i); 1.52 + return ib; 1.53 + } 1.54 + 1.55 + static double simpleb(double i) { 1.56 + Double ib = Double.valueOf(i); 1.57 + return ib; 1.58 + } 1.59 + 1.60 + static double simplec() { 1.61 + Double ib = ibc; 1.62 + return ib; 1.63 + } 1.64 + 1.65 + static double simplef(double i) { 1.66 + Double ib = foob(i); 1.67 + return ib; 1.68 + } 1.69 + 1.70 + static double simplep(Double ib) { 1.71 + return ib; 1.72 + } 1.73 + 1.74 + static double simple2(double i) { 1.75 + Double ib1 = new Double(i); 1.76 + Double ib2 = new Double(i+1.); 1.77 + return ib1 + ib2; 1.78 + } 1.79 + 1.80 + static double simpleb2(double i) { 1.81 + Double ib1 = Double.valueOf(i); 1.82 + Double ib2 = Double.valueOf(i+1.); 1.83 + return ib1 + ib2; 1.84 + } 1.85 + 1.86 + static double simplem2(double i) { 1.87 + Double ib1 = new Double(i); 1.88 + Double ib2 = Double.valueOf(i+1.); 1.89 + return ib1 + ib2; 1.90 + } 1.91 + 1.92 + static double simplep2(double i, Double ib1) { 1.93 + Double ib2 = Double.valueOf(i+1.); 1.94 + return ib1 + ib2; 1.95 + } 1.96 + 1.97 + static double simplec2(double i) { 1.98 + Double ib1 = ibc; 1.99 + Double ib2 = Double.valueOf(i+1.); 1.100 + return ib1 + ib2; 1.101 + } 1.102 + 1.103 + //=============================================== 1.104 + static double test(double f, int i) { 1.105 + Double ib = new Double(f); 1.106 + if ((i&1) == 0) 1.107 + ib = f+1.; 1.108 + return ib; 1.109 + } 1.110 + 1.111 + static double testb(double f, int i) { 1.112 + Double ib = f; 1.113 + if ((i&1) == 0) 1.114 + ib = (f+1.); 1.115 + return ib; 1.116 + } 1.117 + 1.118 + static double testm(double f, int i) { 1.119 + Double ib = f; 1.120 + if ((i&1) == 0) 1.121 + ib = new Double(f+1.); 1.122 + return ib; 1.123 + } 1.124 + 1.125 + static double testp(double f, int i, Double ib) { 1.126 + if ((i&1) == 0) 1.127 + ib = new Double(f+1.); 1.128 + return ib; 1.129 + } 1.130 + 1.131 + static double testc(double f, int i) { 1.132 + Double ib = ibc; 1.133 + if ((i&1) == 0) 1.134 + ib = new Double(f+1.); 1.135 + return ib; 1.136 + } 1.137 + 1.138 + static double test2(double f, int i) { 1.139 + Double ib1 = new Double(f); 1.140 + Double ib2 = new Double(f+1.); 1.141 + if ((i&1) == 0) { 1.142 + ib1 = new Double(f+1.); 1.143 + ib2 = new Double(f+2.); 1.144 + } 1.145 + return ib1+ib2; 1.146 + } 1.147 + 1.148 + static double testb2(double f, int i) { 1.149 + Double ib1 = f; 1.150 + Double ib2 = f+1.; 1.151 + if ((i&1) == 0) { 1.152 + ib1 = (f+1.); 1.153 + ib2 = (f+2.); 1.154 + } 1.155 + return ib1+ib2; 1.156 + } 1.157 + 1.158 + static double testm2(double f, int i) { 1.159 + Double ib1 = new Double(f); 1.160 + Double ib2 = f+1.; 1.161 + if ((i&1) == 0) { 1.162 + ib1 = new Double(f+1.); 1.163 + ib2 = (f+2.); 1.164 + } 1.165 + return ib1+ib2; 1.166 + } 1.167 + 1.168 + static double testp2(double f, int i, Double ib1) { 1.169 + Double ib2 = f+1.; 1.170 + if ((i&1) == 0) { 1.171 + ib1 = new Double(f+1.); 1.172 + ib2 = (f+2.); 1.173 + } 1.174 + return ib1+ib2; 1.175 + } 1.176 + 1.177 + static double testc2(double f, int i) { 1.178 + Double ib1 = ibc; 1.179 + Double ib2 = f+1.; 1.180 + if ((i&1) == 0) { 1.181 + ib1 = (ibc+1.); 1.182 + ib2 = (f+2.); 1.183 + } 1.184 + return ib1+ib2; 1.185 + } 1.186 + 1.187 + //=============================================== 1.188 + static double sum(double[] a) { 1.189 + double result = 1.; 1.190 + for (Double i : a) 1.191 + result += i; 1.192 + return result; 1.193 + } 1.194 + 1.195 + static double sumb(double[] a) { 1.196 + Double result = 1.; 1.197 + for (Double i : a) 1.198 + result += i; 1.199 + return result; 1.200 + } 1.201 + 1.202 + static double sumc(double[] a) { 1.203 + Double result = ibc; 1.204 + for (Double i : a) 1.205 + result += i; 1.206 + return result; 1.207 + } 1.208 + 1.209 + static double sumf(double[] a) { 1.210 + Double result = foob(1.); 1.211 + for (Double i : a) 1.212 + result += i; 1.213 + return result; 1.214 + } 1.215 + 1.216 + static double sump(double[] a, Double result) { 1.217 + for (Double i : a) 1.218 + result += i; 1.219 + return result; 1.220 + } 1.221 + 1.222 + static double sum2(double[] a) { 1.223 + double result1 = 1.; 1.224 + double result2 = 1.; 1.225 + for (Double i : a) { 1.226 + result1 += i; 1.227 + result2 += i + 1.; 1.228 + } 1.229 + return result1 + result2; 1.230 + } 1.231 + 1.232 + static double sumb2(double[] a) { 1.233 + Double result1 = 1.; 1.234 + Double result2 = 1.; 1.235 + for (Double i : a) { 1.236 + result1 += i; 1.237 + result2 += i + 1.; 1.238 + } 1.239 + return result1 + result2; 1.240 + } 1.241 + 1.242 + static double summ2(double[] a) { 1.243 + Double result1 = 1.; 1.244 + Double result2 = new Double(1.); 1.245 + for (Double i : a) { 1.246 + result1 += i; 1.247 + result2 += new Double(i + 1.); 1.248 + } 1.249 + return result1 + result2; 1.250 + } 1.251 + 1.252 + static double sump2(double[] a, Double result2) { 1.253 + Double result1 = 1.; 1.254 + for (Double i : a) { 1.255 + result1 += i; 1.256 + result2 += i + 1.; 1.257 + } 1.258 + return result1 + result2; 1.259 + } 1.260 + 1.261 + static double sumc2(double[] a) { 1.262 + Double result1 = 1.; 1.263 + Double result2 = ibc; 1.264 + for (Double i : a) { 1.265 + result1 += i; 1.266 + result2 += i + ibc; 1.267 + } 1.268 + return result1 + result2; 1.269 + } 1.270 + 1.271 + //=============================================== 1.272 + static double remi_sum() { 1.273 + Double j = new Double(1.); 1.274 + for (int i = 0; i< 1000; i++) { 1.275 + j = new Double(j + 1.); 1.276 + } 1.277 + return j; 1.278 + } 1.279 + 1.280 + static double remi_sumb() { 1.281 + Double j = Double.valueOf(1.); 1.282 + for (int i = 0; i< 1000; i++) { 1.283 + j = j + 1.; 1.284 + } 1.285 + return j; 1.286 + } 1.287 + 1.288 + static double remi_sumf() { 1.289 + Double j = foob(1.); 1.290 + for (int i = 0; i< 1000; i++) { 1.291 + j = j + 1.; 1.292 + } 1.293 + return j; 1.294 + } 1.295 + 1.296 + static double remi_sump(Double j) { 1.297 + for (int i = 0; i< 1000; i++) { 1.298 + j = new Double(j + 1.); 1.299 + } 1.300 + return j; 1.301 + } 1.302 + 1.303 + static double remi_sumc() { 1.304 + Double j = ibc; 1.305 + for (int i = 0; i< 1000; i++) { 1.306 + j = j + ibc; 1.307 + } 1.308 + return j; 1.309 + } 1.310 + 1.311 + static double remi_sum2() { 1.312 + Double j1 = new Double(1.); 1.313 + Double j2 = new Double(1.); 1.314 + for (int i = 0; i< 1000; i++) { 1.315 + j1 = new Double(j1 + 1.); 1.316 + j2 = new Double(j2 + 2.); 1.317 + } 1.318 + return j1 + j2; 1.319 + } 1.320 + 1.321 + static double remi_sumb2() { 1.322 + Double j1 = Double.valueOf(1.); 1.323 + Double j2 = Double.valueOf(1.); 1.324 + for (int i = 0; i< 1000; i++) { 1.325 + j1 = j1 + 1.; 1.326 + j2 = j2 + 2.; 1.327 + } 1.328 + return j1 + j2; 1.329 + } 1.330 + 1.331 + static double remi_summ2() { 1.332 + Double j1 = new Double(1.); 1.333 + Double j2 = Double.valueOf(1.); 1.334 + for (int i = 0; i< 1000; i++) { 1.335 + j1 = new Double(j1 + 1.); 1.336 + j2 = j2 + 2.; 1.337 + } 1.338 + return j1 + j2; 1.339 + } 1.340 + 1.341 + static double remi_sump2(Double j1) { 1.342 + Double j2 = Double.valueOf(1.); 1.343 + for (int i = 0; i< 1000; i++) { 1.344 + j1 = new Double(j1 + 1.); 1.345 + j2 = j2 + 2.; 1.346 + } 1.347 + return j1 + j2; 1.348 + } 1.349 + 1.350 + static double remi_sumc2() { 1.351 + Double j1 = ibc; 1.352 + Double j2 = Double.valueOf(1.); 1.353 + for (int i = 0; i< 1000; i++) { 1.354 + j1 = j1 + ibc; 1.355 + j2 = j2 + 2.; 1.356 + } 1.357 + return j1 + j2; 1.358 + } 1.359 + 1.360 + 1.361 + //=============================================== 1.362 + // Safepointa and debug info for deoptimization 1.363 + static double simple_deop(double i) { 1.364 + Double ib = new Double(foo(i)); 1.365 + dummy(); 1.366 + return ib; 1.367 + } 1.368 + 1.369 + static double simpleb_deop(double i) { 1.370 + Double ib = Double.valueOf(foo(i)); 1.371 + dummy(); 1.372 + return ib; 1.373 + } 1.374 + 1.375 + static double simplef_deop(double i) { 1.376 + Double ib = foob(i); 1.377 + dummy(); 1.378 + return ib; 1.379 + } 1.380 + 1.381 + static double simplep_deop(Double ib) { 1.382 + dummy(); 1.383 + return ib; 1.384 + } 1.385 + 1.386 + static double simplec_deop(double i) { 1.387 + Double ib = ibc; 1.388 + dummy(); 1.389 + return ib; 1.390 + } 1.391 + 1.392 + static double test_deop(double f, int i) { 1.393 + Double ib = new Double(foo(f)); 1.394 + if ((i&1) == 0) 1.395 + ib = foo(f+1.); 1.396 + dummy(); 1.397 + return ib; 1.398 + } 1.399 + 1.400 + static double testb_deop(double f, int i) { 1.401 + Double ib = foo(f); 1.402 + if ((i&1) == 0) 1.403 + ib = foo(f+1.); 1.404 + dummy(); 1.405 + return ib; 1.406 + } 1.407 + 1.408 + static double testf_deop(double f, int i) { 1.409 + Double ib = foob(f); 1.410 + if ((i&1) == 0) 1.411 + ib = foo(f+1.); 1.412 + dummy(); 1.413 + return ib; 1.414 + } 1.415 + 1.416 + static double testp_deop(double f, int i, Double ib) { 1.417 + if ((i&1) == 0) 1.418 + ib = foo(f+1.); 1.419 + dummy(); 1.420 + return ib; 1.421 + } 1.422 + 1.423 + static double testc_deop(double f, int i) { 1.424 + Double ib = ibc; 1.425 + if ((i&1) == 0) 1.426 + ib = foo(f+1.); 1.427 + dummy(); 1.428 + return ib; 1.429 + } 1.430 + 1.431 + static double sum_deop(double[] a) { 1.432 + double result = 1.; 1.433 + for (Double i : a) 1.434 + result += foo(i); 1.435 + dummy(); 1.436 + return result; 1.437 + } 1.438 + 1.439 + static double sumb_deop(double[] a) { 1.440 + Double result = 1.; 1.441 + for (Double i : a) 1.442 + result += foo(i); 1.443 + dummy(); 1.444 + return result; 1.445 + } 1.446 + 1.447 + static double sumf_deop(double[] a) { 1.448 + Double result = 1.; 1.449 + for (Double i : a) 1.450 + result += foob(i); 1.451 + dummy(); 1.452 + return result; 1.453 + } 1.454 + 1.455 + static double sump_deop(double[] a, Double result) { 1.456 + for (Double i : a) 1.457 + result += foob(i); 1.458 + dummy(); 1.459 + return result; 1.460 + } 1.461 + 1.462 + static double sumc_deop(double[] a) { 1.463 + Double result = ibc; 1.464 + for (Double i : a) 1.465 + result += foo(i); 1.466 + dummy(); 1.467 + return result; 1.468 + } 1.469 + 1.470 + static double remi_sum_deop() { 1.471 + Double j = new Double(foo(1.)); 1.472 + for (int i = 0; i< 1000; i++) { 1.473 + j = new Double(foo(j + 1.)); 1.474 + } 1.475 + dummy(); 1.476 + return j; 1.477 + } 1.478 + 1.479 + static double remi_sumb_deop() { 1.480 + Double j = Double.valueOf(foo(1.)); 1.481 + for (int i = 0; i< 1000; i++) { 1.482 + j = foo(j + 1.); 1.483 + } 1.484 + dummy(); 1.485 + return j; 1.486 + } 1.487 + 1.488 + static double remi_sumf_deop() { 1.489 + Double j = foob(1.); 1.490 + for (int i = 0; i< 1000; i++) { 1.491 + j = foo(j + 1.); 1.492 + } 1.493 + dummy(); 1.494 + return j; 1.495 + } 1.496 + 1.497 + static double remi_sump_deop(Double j) { 1.498 + for (int i = 0; i< 1000; i++) { 1.499 + j = foo(j + 1.); 1.500 + } 1.501 + dummy(); 1.502 + return j; 1.503 + } 1.504 + 1.505 + static double remi_sumc_deop() { 1.506 + Double j = ibc; 1.507 + for (int i = 0; i< 1000; i++) { 1.508 + j = foo(j + 1.); 1.509 + } 1.510 + dummy(); 1.511 + return j; 1.512 + } 1.513 + 1.514 + //=============================================== 1.515 + // Conditional increment 1.516 + static double remi_sum_cond() { 1.517 + Double j = new Double(1.); 1.518 + for (int i = 0; i< 1000; i++) { 1.519 + if ((i&1) == 0) { 1.520 + j = new Double(j + 1.); 1.521 + } 1.522 + } 1.523 + return j; 1.524 + } 1.525 + 1.526 + static double remi_sumb_cond() { 1.527 + Double j = Double.valueOf(1.); 1.528 + for (int i = 0; i< 1000; i++) { 1.529 + if ((i&1) == 0) { 1.530 + j = j + 1.; 1.531 + } 1.532 + } 1.533 + return j; 1.534 + } 1.535 + 1.536 + static double remi_sumf_cond() { 1.537 + Double j = foob(1.); 1.538 + for (int i = 0; i< 1000; i++) { 1.539 + if ((i&1) == 0) { 1.540 + j = j + 1.; 1.541 + } 1.542 + } 1.543 + return j; 1.544 + } 1.545 + 1.546 + static double remi_sump_cond(Double j) { 1.547 + for (int i = 0; i< 1000; i++) { 1.548 + if ((i&1) == 0) { 1.549 + j = j + 1.; 1.550 + } 1.551 + } 1.552 + return j; 1.553 + } 1.554 + 1.555 + static double remi_sumc_cond() { 1.556 + Double j = ibc; 1.557 + for (int i = 0; i< 1000; i++) { 1.558 + if ((i&1) == 0) { 1.559 + j = j + ibc; 1.560 + } 1.561 + } 1.562 + return j; 1.563 + } 1.564 + 1.565 + static double remi_sum2_cond() { 1.566 + Double j1 = new Double(1.); 1.567 + Double j2 = new Double(1.); 1.568 + for (int i = 0; i< 1000; i++) { 1.569 + if ((i&1) == 0) { 1.570 + j1 = new Double(j1 + 1.); 1.571 + } else { 1.572 + j2 = new Double(j2 + 2.); 1.573 + } 1.574 + } 1.575 + return j1 + j2; 1.576 + } 1.577 + 1.578 + static double remi_sumb2_cond() { 1.579 + Double j1 = Double.valueOf(1.); 1.580 + Double j2 = Double.valueOf(1.); 1.581 + for (int i = 0; i< 1000; i++) { 1.582 + if ((i&1) == 0) { 1.583 + j1 = j1 + 1.; 1.584 + } else { 1.585 + j2 = j2 + 2.; 1.586 + } 1.587 + } 1.588 + return j1 + j2; 1.589 + } 1.590 + 1.591 + static double remi_summ2_cond() { 1.592 + Double j1 = new Double(1.); 1.593 + Double j2 = Double.valueOf(1.); 1.594 + for (int i = 0; i< 1000; i++) { 1.595 + if ((i&1) == 0) { 1.596 + j1 = new Double(j1 + 1.); 1.597 + } else { 1.598 + j2 = j2 + 2.; 1.599 + } 1.600 + } 1.601 + return j1 + j2; 1.602 + } 1.603 + 1.604 + static double remi_sump2_cond(Double j1) { 1.605 + Double j2 = Double.valueOf(1.); 1.606 + for (int i = 0; i< 1000; i++) { 1.607 + if ((i&1) == 0) { 1.608 + j1 = new Double(j1 + 1.); 1.609 + } else { 1.610 + j2 = j2 + 2.; 1.611 + } 1.612 + } 1.613 + return j1 + j2; 1.614 + } 1.615 + 1.616 + static double remi_sumc2_cond() { 1.617 + Double j1 = ibc; 1.618 + Double j2 = Double.valueOf(1.); 1.619 + for (int i = 0; i< 1000; i++) { 1.620 + if ((i&1) == 0) { 1.621 + j1 = j1 + ibc; 1.622 + } else { 1.623 + j2 = j2 + 2; 1.624 + } 1.625 + } 1.626 + return j1 + j2; 1.627 + } 1.628 + 1.629 + 1.630 + public static void main(String[] args) { 1.631 + final int ntests = 70; 1.632 + 1.633 + String[] test_name = new String[] { 1.634 + "simple", "simpleb", "simplec", "simplef", "simplep", 1.635 + "simple2", "simpleb2", "simplec2", "simplem2", "simplep2", 1.636 + "simple_deop", "simpleb_deop", "simplec_deop", "simplef_deop", "simplep_deop", 1.637 + "test", "testb", "testc", "testm", "testp", 1.638 + "test2", "testb2", "testc2", "testm2", "testp2", 1.639 + "test_deop", "testb_deop", "testc_deop", "testf_deop", "testp_deop", 1.640 + "sum", "sumb", "sumc", "sumf", "sump", 1.641 + "sum2", "sumb2", "sumc2", "summ2", "sump2", 1.642 + "sum_deop", "sumb_deop", "sumc_deop", "sumf_deop", "sump_deop", 1.643 + "remi_sum", "remi_sumb", "remi_sumc", "remi_sumf", "remi_sump", 1.644 + "remi_sum2", "remi_sumb2", "remi_sumc2", "remi_summ2", "remi_sump2", 1.645 + "remi_sum_deop", "remi_sumb_deop", "remi_sumc_deop", "remi_sumf_deop", "remi_sump_deop", 1.646 + "remi_sum_cond", "remi_sumb_cond", "remi_sumc_cond", "remi_sumf_cond", "remi_sump_cond", 1.647 + "remi_sum2_cond", "remi_sumb2_cond", "remi_sumc2_cond", "remi_summ2_cond", "remi_sump2_cond" 1.648 + }; 1.649 + 1.650 + final double[] val = new double[] { 1.651 + 71994000., 71994000., 12000., 71994000., 71994000., 1.652 + 144000000., 144000000., 72018000., 144000000., 144000000., 1.653 + 71994000., 71994000., 12000., 71994000., 71994000., 1.654 + 72000000., 72000000., 36006000., 72000000., 72000000., 1.655 + 144012000., 144012000., 72030000., 144012000., 144012000., 1.656 + 72000000., 72000000., 36006000., 72000000., 72000000., 1.657 + 499501., 499501., 499501., 499501., 499501., 1.658 + 1000002., 1000002., 1000002., 1000002., 1000002., 1.659 + 499501., 499501., 499501., 499501., 499501., 1.660 + 1001., 1001., 1001., 1001., 1001., 1.661 + 3002., 3002., 3002., 3002., 3002., 1.662 + 1001., 1001., 1001., 1001., 1001., 1.663 + 501., 501., 501., 501., 501., 1.664 + 1502., 1502., 1502., 1502., 1502. 1.665 + }; 1.666 + 1.667 + double[] res = new double[ntests]; 1.668 + for (int i = 0; i < ntests; i++) { 1.669 + res[i] = 0.; 1.670 + } 1.671 + 1.672 + 1.673 + for (int i = 0; i < 12000; i++) { 1.674 + res[0] += simple(i); 1.675 + res[1] += simpleb(i); 1.676 + res[2] += simplec(); 1.677 + res[3] += simplef(i); 1.678 + res[4] += simplep((double)i); 1.679 + 1.680 + res[5] += simple2((double)i); 1.681 + res[6] += simpleb2((double)i); 1.682 + res[7] += simplec2((double)i); 1.683 + res[8] += simplem2((double)i); 1.684 + res[9] += simplep2((double)i, (double)i); 1.685 + 1.686 + res[10] += simple_deop((double)i); 1.687 + res[11] += simpleb_deop((double)i); 1.688 + res[12] += simplec_deop((double)i); 1.689 + res[13] += simplef_deop((double)i); 1.690 + res[14] += simplep_deop((double)i); 1.691 + 1.692 + res[15] += test((double)i, i); 1.693 + res[16] += testb((double)i, i); 1.694 + res[17] += testc((double)i, i); 1.695 + res[18] += testm((double)i, i); 1.696 + res[19] += testp((double)i, i, (double)i); 1.697 + 1.698 + res[20] += test2((double)i, i); 1.699 + res[21] += testb2((double)i, i); 1.700 + res[22] += testc2((double)i, i); 1.701 + res[23] += testm2((double)i, i); 1.702 + res[24] += testp2((double)i, i, (double)i); 1.703 + 1.704 + res[25] += test_deop((double)i, i); 1.705 + res[26] += testb_deop((double)i, i); 1.706 + res[27] += testc_deop((double)i, i); 1.707 + res[28] += testf_deop((double)i, i); 1.708 + res[29] += testp_deop((double)i, i, (double)i); 1.709 + } 1.710 + 1.711 + double[] ia = new double[1000]; 1.712 + for (int i = 0; i < 1000; i++) { 1.713 + ia[i] = i; 1.714 + } 1.715 + 1.716 + for (int i = 0; i < 100; i++) { 1.717 + res[30] = sum(ia); 1.718 + res[31] = sumb(ia); 1.719 + res[32] = sumc(ia); 1.720 + res[33] = sumf(ia); 1.721 + res[34] = sump(ia, 1.); 1.722 + 1.723 + res[35] = sum2(ia); 1.724 + res[36] = sumb2(ia); 1.725 + res[37] = sumc2(ia); 1.726 + res[38] = summ2(ia); 1.727 + res[39] = sump2(ia, 1.); 1.728 + 1.729 + res[40] = sum_deop(ia); 1.730 + res[41] = sumb_deop(ia); 1.731 + res[42] = sumc_deop(ia); 1.732 + res[43] = sumf_deop(ia); 1.733 + res[44] = sump_deop(ia, 1.); 1.734 + 1.735 + res[45] = remi_sum(); 1.736 + res[46] = remi_sumb(); 1.737 + res[47] = remi_sumc(); 1.738 + res[48] = remi_sumf(); 1.739 + res[49] = remi_sump(1.); 1.740 + 1.741 + res[50] = remi_sum2(); 1.742 + res[51] = remi_sumb2(); 1.743 + res[52] = remi_sumc2(); 1.744 + res[53] = remi_summ2(); 1.745 + res[54] = remi_sump2(1.); 1.746 + 1.747 + res[55] = remi_sum_deop(); 1.748 + res[56] = remi_sumb_deop(); 1.749 + res[57] = remi_sumc_deop(); 1.750 + res[58] = remi_sumf_deop(); 1.751 + res[59] = remi_sump_deop(1.); 1.752 + 1.753 + res[60] = remi_sum_cond(); 1.754 + res[61] = remi_sumb_cond(); 1.755 + res[62] = remi_sumc_cond(); 1.756 + res[63] = remi_sumf_cond(); 1.757 + res[64] = remi_sump_cond(1.); 1.758 + 1.759 + res[65] = remi_sum2_cond(); 1.760 + res[66] = remi_sumb2_cond(); 1.761 + res[67] = remi_sumc2_cond(); 1.762 + res[68] = remi_summ2_cond(); 1.763 + res[69] = remi_sump2_cond(1.); 1.764 + } 1.765 + 1.766 + int failed = 0; 1.767 + for (int i = 0; i < ntests; i++) { 1.768 + if (res[i] != val[i]) { 1.769 + System.err.println(test_name[i] + ": " + res[i] + " != " + val[i]); 1.770 + failed++; 1.771 + } 1.772 + } 1.773 + if (failed > 0) { 1.774 + System.err.println("Failed " + failed + " tests."); 1.775 + throw new InternalError(); 1.776 + } else { 1.777 + System.out.println("Passed."); 1.778 + } 1.779 + } 1.780 +}