2014-06-02 21:36:59 -04:00
|
|
|
/*
|
2018-02-15 11:39:42 -08:00
|
|
|
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
2014-06-02 21:36:59 -04:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
|
|
|
*/
|
|
|
|
|
2017-08-03 10:24:34 +02:00
|
|
|
/**
|
2014-06-02 21:36:59 -04:00
|
|
|
* @test SharedBaseAddress
|
|
|
|
* @summary Test variety of values for SharedBaseAddress, making sure
|
|
|
|
* VM handles normal values as well as edge values w/o a crash.
|
2017-12-04 08:59:47 -08:00
|
|
|
* @requires vm.cds
|
2016-08-19 10:06:30 -04:00
|
|
|
* @library /test/lib
|
2016-04-09 23:03:39 +01:00
|
|
|
* @modules java.base/jdk.internal.misc
|
2015-03-26 16:36:56 +01:00
|
|
|
* java.management
|
2018-10-02 14:32:33 -07:00
|
|
|
* @run driver SharedBaseAddress
|
2014-06-02 21:36:59 -04:00
|
|
|
*/
|
|
|
|
|
2017-04-18 14:18:43 -07:00
|
|
|
import jdk.test.lib.cds.CDSTestUtils;
|
|
|
|
import jdk.test.lib.cds.CDSOptions;
|
2016-08-19 10:06:30 -04:00
|
|
|
import jdk.test.lib.process.OutputAnalyzer;
|
2014-06-02 21:36:59 -04:00
|
|
|
|
|
|
|
public class SharedBaseAddress {
|
|
|
|
|
|
|
|
// shared base address test table
|
|
|
|
private static final String[] testTable = {
|
|
|
|
"1g", "8g", "64g","512g", "4t",
|
|
|
|
"32t", "128t", "0",
|
|
|
|
"1", "64k", "64M"
|
|
|
|
};
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
|
|
|
|
for (String testEntry : testTable) {
|
2015-03-30 08:28:07 -07:00
|
|
|
String filename = "SharedBaseAddress" + testEntry + ".jsa";
|
2014-06-02 21:36:59 -04:00
|
|
|
System.out.println("sharedBaseAddress = " + testEntry);
|
2017-04-18 14:18:43 -07:00
|
|
|
CDSOptions opts = (new CDSOptions())
|
|
|
|
.setArchiveName(filename)
|
|
|
|
.addPrefix("-XX:SharedBaseAddress=" + testEntry);
|
2014-06-02 21:36:59 -04:00
|
|
|
|
2017-04-18 14:18:43 -07:00
|
|
|
CDSTestUtils.createArchiveAndCheck(opts);
|
|
|
|
CDSTestUtils.runWithArchiveAndCheck(opts);
|
2014-06-02 21:36:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|