hseigel@5528: /* hseigel@5528: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. hseigel@5528: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hseigel@5528: * hseigel@5528: * This code is free software; you can redistribute it and/or modify it hseigel@5528: * under the terms of the GNU General Public License version 2 only, as hseigel@5528: * published by the Free Software Foundation. hseigel@5528: * hseigel@5528: * This code is distributed in the hope that it will be useful, but WITHOUT hseigel@5528: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hseigel@5528: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hseigel@5528: * version 2 for more details (a copy is included in the LICENSE file that hseigel@5528: * accompanied this code). hseigel@5528: * hseigel@5528: * You should have received a copy of the GNU General Public License version hseigel@5528: * 2 along with this work; if not, write to the Free Software Foundation, hseigel@5528: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hseigel@5528: * hseigel@5528: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hseigel@5528: * or visit www.oracle.com if you need additional information or have any hseigel@5528: * questions. hseigel@5528: */ hseigel@5528: hseigel@5528: /* hseigel@5528: * @test hseigel@5528: * @bug 8003424 ehelin@5694: * @summary Testing UseCompressedClassPointers with CDS hseigel@5528: * @library /testlibrary hseigel@5528: * @run main CDSCompressedKPtrs hseigel@5528: */ hseigel@5528: hseigel@5528: import com.oracle.java.testlibrary.*; hseigel@5528: hseigel@5528: public class CDSCompressedKPtrs { hseigel@5528: public static void main(String[] args) throws Exception { hseigel@5528: ProcessBuilder pb; hseigel@5528: if (Platform.is64bit()) { hseigel@5528: pb = ProcessTools.createJavaProcessBuilder( ehelin@5694: "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", hseigel@5528: "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); hseigel@5528: OutputAnalyzer output = new OutputAnalyzer(pb.start()); hseigel@5528: try { hseigel@5528: output.shouldContain("Loading classes to share"); hseigel@5528: output.shouldHaveExitValue(0); hseigel@5528: hseigel@5528: pb = ProcessTools.createJavaProcessBuilder( ehelin@5694: "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", hseigel@5528: "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); hseigel@5528: output = new OutputAnalyzer(pb.start()); hseigel@5528: output.shouldContain("sharing"); hseigel@5528: output.shouldHaveExitValue(0); hseigel@5528: hseigel@5528: } catch (RuntimeException e) { hseigel@5625: // Report 'passed' if CDS was turned off. hseigel@5625: output.shouldContain("Unable to use shared archive"); hseigel@5528: output.shouldHaveExitValue(1); hseigel@5528: } hseigel@5528: } hseigel@5528: } hseigel@5528: }