test/compiler/8005956/PolynomialRoot.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff test/compiler/8005956/PolynomialRoot.java
test/compiler/8005956/PolynomialRoot.java
Print this page
rev 7259 : 8044186: Introduce a reproducible random generator
Reviewed-by: iignatyev
Contributed-by: sergei.kovalev@oracle.com
*** 1,6 ****
- //package com.polytechnik.utils;
/*
* (C) Vladislav Malyshkin 2010
* This file is under GPL version 3.
*
*/
--- 1,5 ----
*** 12,25 ****
/**
* @test
* @bug 8005956
* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
! *
* @run main/timeout=300 PolynomialRoot
*/
public class PolynomialRoot {
public static int findPolynomialRoots(final int n,
final double [] p,
--- 11,28 ----
/**
* @test
* @bug 8005956
* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
! * @library /testlibrary
* @run main/timeout=300 PolynomialRoot
*/
+ import com.oracle.java.testlibrary.Utils;
+ import java.util.Arrays;
+ import java.util.Random;
+
public class PolynomialRoot {
public static int findPolynomialRoots(final int n,
final double [] p,
*** 55,65 ****
private static final boolean PRINT_DEBUG=false;
public static int root4(final double [] p,final double [] re_root,final double [] im_root)
{
! if(PRINT_DEBUG) System.err.println("=====================root4:p="+java.util.Arrays.toString(p));
final double vs=p[4];
if(PRINT_DEBUG) System.err.println("p[4]="+p[4]);
if(!(Math.abs(vs)>EPS))
{
re_root[0]=re_root[1]=re_root[2]=re_root[3]=
--- 58,68 ----
private static final boolean PRINT_DEBUG=false;
public static int root4(final double [] p,final double [] re_root,final double [] im_root)
{
! if (PRINT_DEBUG) { System.err.println("=====================root4:p=" + Arrays.toString(p)); }
final double vs=p[4];
if(PRINT_DEBUG) System.err.println("p[4]="+p[4]);
if(!(Math.abs(vs)>EPS))
{
re_root[0]=re_root[1]=re_root[2]=re_root[3]=
*** 365,375 ****
return 4;
}
! static void setRandomP(final double [] p,final int n,java.util.Random r)
{
if(r.nextDouble()<0.1)
{
// integer coefficiens
for(int j=0;j<p.length;j++)
--- 368,378 ----
return 4;
}
! static void setRandomP(final double [] p, final int n, Random r)
{
if(r.nextDouble()<0.1)
{
// integer coefficiens
for(int j=0;j<p.length;j++)
*** 463,473 ****
return buf.toString();
}
static void testRoots(final int n,
final int n_tests,
! final java.util.Random rn,
final double eps)
{
final double [] p=new double [n+1];
final double [] rex=new double [n],imx=new double [n];
for(int i=0;i<n_tests;i++)
--- 466,476 ----
return buf.toString();
}
static void testRoots(final int n,
final int n_tests,
! final Random rn,
final double eps)
{
final double [] p=new double [n+1];
final double [] rex=new double [n],imx=new double [n];
for(int i=0;i<n_tests;i++)
*** 761,771 ****
System.getProperty("os.arch").equals("amd64") ||
System.getProperty("os.arch").equals("x86_64")){
final long t0=System.currentTimeMillis();
final double eps=1e-6;
//checkRoots();
! final java.util.Random r=new java.util.Random(-1381923);
printSpecialValues();
final int n_tests=100000;
//testRoots(2,n_tests,r,eps);
//testRoots(3,n_tests,r,eps);
--- 764,774 ----
System.getProperty("os.arch").equals("amd64") ||
System.getProperty("os.arch").equals("x86_64")){
final long t0=System.currentTimeMillis();
final double eps=1e-6;
//checkRoots();
! final Random r = Utils.getRandomInstance();
printSpecialValues();
final int n_tests=100000;
//testRoots(2,n_tests,r,eps);
//testRoots(3,n_tests,r,eps);
test/compiler/8005956/PolynomialRoot.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File