Tue, 28 Jan 2014 14:56:01 -0800
Added tag jdk8u5-b06 for changeset 956c0e048ef2
ctornqvi@5473 | 1 | /* |
ctornqvi@5473 | 2 | * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
ctornqvi@5473 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ctornqvi@5473 | 4 | * |
ctornqvi@5473 | 5 | * This code is free software; you can redistribute it and/or modify it |
ctornqvi@5473 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ctornqvi@5473 | 7 | * published by the Free Software Foundation. |
ctornqvi@5473 | 8 | * |
ctornqvi@5473 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
ctornqvi@5473 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ctornqvi@5473 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ctornqvi@5473 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
ctornqvi@5473 | 13 | * accompanied this code). |
ctornqvi@5473 | 14 | * |
ctornqvi@5473 | 15 | * You should have received a copy of the GNU General Public License version |
ctornqvi@5473 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
ctornqvi@5473 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ctornqvi@5473 | 18 | * |
ctornqvi@5473 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ctornqvi@5473 | 20 | * or visit www.oracle.com if you need additional information or have any |
ctornqvi@5473 | 21 | * questions. |
ctornqvi@5473 | 22 | */ |
ctornqvi@5473 | 23 | |
ctornqvi@5473 | 24 | /* |
ctornqvi@5473 | 25 | * @test |
ctornqvi@5473 | 26 | * @bug 8000968 |
ctornqvi@5473 | 27 | * @key regression |
ehelin@5694 | 28 | * @summary NPG: UseCompressedClassPointers asserts with ObjectAlignmentInBytes=32 |
ctornqvi@5473 | 29 | * @library /testlibrary |
ctornqvi@5473 | 30 | */ |
ctornqvi@5473 | 31 | |
ctornqvi@5473 | 32 | import com.oracle.java.testlibrary.*; |
ctornqvi@5473 | 33 | |
ctornqvi@5473 | 34 | public class CompressedKlassPointerAndOops { |
ctornqvi@5473 | 35 | |
ctornqvi@5473 | 36 | public static void main(String[] args) throws Exception { |
ctornqvi@5473 | 37 | |
ctornqvi@5473 | 38 | if (!Platform.is64bit()) { |
ctornqvi@5473 | 39 | // Can't test this on 32 bit, just pass |
ctornqvi@5473 | 40 | System.out.println("Skipping test on 32bit"); |
ctornqvi@5473 | 41 | return; |
ctornqvi@5473 | 42 | } |
ctornqvi@5473 | 43 | |
ctornqvi@5473 | 44 | runWithAlignment(16); |
ctornqvi@5473 | 45 | runWithAlignment(32); |
ctornqvi@5473 | 46 | runWithAlignment(64); |
ctornqvi@5473 | 47 | runWithAlignment(128); |
ctornqvi@5473 | 48 | } |
ctornqvi@5473 | 49 | |
ctornqvi@5473 | 50 | private static void runWithAlignment(int alignment) throws Exception { |
ctornqvi@5473 | 51 | ProcessBuilder pb; |
ctornqvi@5473 | 52 | OutputAnalyzer output; |
ctornqvi@5473 | 53 | |
ctornqvi@5473 | 54 | pb = ProcessTools.createJavaProcessBuilder( |
ehelin@5694 | 55 | "-XX:+UseCompressedClassPointers", |
ctornqvi@5473 | 56 | "-XX:+UseCompressedOops", |
ctornqvi@5473 | 57 | "-XX:ObjectAlignmentInBytes=" + alignment, |
ctornqvi@5473 | 58 | "-version"); |
ctornqvi@5473 | 59 | |
ctornqvi@5473 | 60 | output = new OutputAnalyzer(pb.start()); |
ctornqvi@5473 | 61 | output.shouldHaveExitValue(0); |
ctornqvi@5473 | 62 | } |
ctornqvi@5473 | 63 | } |