iignatyev@6963: /* iignatyev@6963: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. iignatyev@6963: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. iignatyev@6963: * iignatyev@6963: * This code is free software; you can redistribute it and/or modify it iignatyev@6963: * under the terms of the GNU General Public License version 2 only, as iignatyev@6963: * published by the Free Software Foundation. iignatyev@6963: * iignatyev@6963: * This code is distributed in the hope that it will be useful, but WITHOUT iignatyev@6963: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or iignatyev@6963: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License iignatyev@6963: * version 2 for more details (a copy is included in the LICENSE file that iignatyev@6963: * accompanied this code). iignatyev@6963: * iignatyev@6963: * You should have received a copy of the GNU General Public License version iignatyev@6963: * 2 along with this work; if not, write to the Free Software Foundation, iignatyev@6963: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. iignatyev@6963: * iignatyev@6963: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA iignatyev@6963: * or visit www.oracle.com if you need additional information or have any iignatyev@6963: * questions. iignatyev@6963: */ iignatyev@6963: iignatyev@6963: /* iignatyev@6963: * @test UintxTest iignatyev@6963: * @bug 8028756 iignatyev@6963: * @library /testlibrary /testlibrary/whitebox iignatyev@6963: * @build UintxTest iignatyev@6963: * @run main ClassFileInstaller sun.hotspot.WhiteBox iignatyev@6963: * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI UintxTest iignatyev@6963: * @summary testing of WB::set/getUintxVMFlag() iignatyev@6963: * @author igor.ignatyev@oracle.com iignatyev@6963: */ iignatyev@6963: import com.oracle.java.testlibrary.Platform; iignatyev@6963: iignatyev@6963: public class UintxTest { iignatyev@6963: private static final String FLAG_NAME = "TypeProfileLevel"; iignatyev@6963: private static final Long[] TESTS = {0L, 100L, (long) Integer.MAX_VALUE, iignatyev@6963: (1L << 32L) - 1L, 1L << 32L}; iignatyev@6963: private static final Long[] EXPECTED_64 = TESTS; iignatyev@6963: private static final Long[] EXPECTED_32 = {0L, 100L, iignatyev@6963: (long) Integer.MAX_VALUE, (1L << 32L) - 1L, 0L}; iignatyev@6963: iignatyev@6963: public static void main(String[] args) throws Exception { iignatyev@6963: VmFlagTest.runTest(FLAG_NAME, TESTS, iignatyev@6963: Platform.is64bit() ? EXPECTED_64 : EXPECTED_32, iignatyev@6963: VmFlagTest.WHITE_BOX::setUintxVMFlag, iignatyev@6963: VmFlagTest.WHITE_BOX::getUintxVMFlag); iignatyev@6963: } iignatyev@6963: } iignatyev@6963: