< prev index next >

test/compiler/loopopts/TestLogSum.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke

   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  * @test
  26  * @bug 8046516
  27  * @summary Segmentation fault in JVM (easily reproducible)
  28  * @run main/othervm -XX:-TieredCompilation -Xbatch TestLogSum

  29  * @author jackkamm@gmail.com
  30  */
  31 


  32 import java.util.Arrays;
  33 import java.util.HashMap;
  34 import java.util.List;
  35 import java.util.Map;

  36 public class TestLogSum {
  37   public static void main(String[] args) {
  38     double sum;
  39 
  40     for (int i = 0; i < 6; i++) {
  41         for (int n = 2; n < 30; n++) {
  42            for (int j = 1; j <= n; j++) {
  43               for (int k = 1; k <= j; k++) {
  44                 // System.out.println(computeSum(k, j));
  45                 sum = computeSum(k, j);
  46               }
  47            }
  48         }
  49       }
  50    }
  51 
  52    private static Map<List<Integer>, Double> cache = new HashMap<List<Integer>, Double>();
  53    public static double computeSum(int x, int y) {
  54       List<Integer> key = Arrays.asList(new Integer[] {x, y});
  55 



   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  * @test
  26  * @bug 8046516
  27  * @summary Segmentation fault in JVM (easily reproducible)
  28  *
  29  * @run main/othervm -XX:-TieredCompilation -Xbatch compiler.loopopts.TestLogSum
  30  * @author jackkamm@gmail.com
  31  */
  32 
  33 package compiler.loopopts;
  34 
  35 import java.util.Arrays;
  36 import java.util.HashMap;
  37 import java.util.List;
  38 import java.util.Map;
  39 
  40 public class TestLogSum {
  41   public static void main(String[] args) {
  42     double sum;
  43 
  44     for (int i = 0; i < 6; i++) {
  45         for (int n = 2; n < 30; n++) {
  46            for (int j = 1; j <= n; j++) {
  47               for (int k = 1; k <= j; k++) {
  48                 // System.out.println(computeSum(k, j));
  49                 sum = computeSum(k, j);
  50               }
  51            }
  52         }
  53       }
  54    }
  55 
  56    private static Map<List<Integer>, Double> cache = new HashMap<List<Integer>, Double>();
  57    public static double computeSum(int x, int y) {
  58       List<Integer> key = Arrays.asList(new Integer[] {x, y});
  59 


< prev index next >