Java Code Examples for jdk.test.lib.Platform#isS390x()

The following examples show how to use jdk.test.lib.Platform#isS390x() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SHAOptionsBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns warning message that should occur in VM output if an option with
 * the name {@code optionName} was turned on and CPU does not support
 * required instructions.
 *
 * @param optionName The name of the option for which warning message should
 *                   be returned.
 * @return A warning message that will be printed out to VM output if CPU
 *         instructions required by the option are not supported.
 */
public static String getWarningForUnsupportedCPU(String optionName) {
    if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() ||
        Platform.isX64() || Platform.isX86()) {
        switch (optionName) {
        case SHAOptionsBase.USE_SHA_OPTION:
            return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
            return SHAOptionsBase.SHA1_INTRINSICS_ARE_NOT_AVAILABLE;
        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
            return SHAOptionsBase.SHA256_INTRINSICS_ARE_NOT_AVAILABLE;
        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
            return SHAOptionsBase.SHA512_INTRINSICS_ARE_NOT_AVAILABLE;
        default:
            throw new Error("Unexpected option " + optionName);
        }
    } else {
        throw new Error("Support for CPUs different fromn AARCH64, S390x, SPARC, and X86 "
                        + "is not implemented");
    }
}
 
Example 2
Source File: ReservedStackTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
@jdk.internal.vm.annotation.ReservedStackAccess
public void run() {
    counter = 0;
    decounter = deframe;
    test.initialize();
    recursiveCall();
    System.out.println("Framework got StackOverflowError at frame = " + counter);
    System.out.println("Test started execution at frame = " + (counter - deframe));
    String result = test.getResult();
    // The feature is not fully implemented on all platforms,
    // corruptions are still possible.
    boolean supportedPlatform =
        Platform.isAix() ||
        (Platform.isLinux() &&
          (Platform.isPPC() || Platform.isS390x() || Platform.isX64() ||
           Platform.isX86() || Platform.isAArch64())) ||
        Platform.isOSX() ||
        Platform.isSolaris();
    if (supportedPlatform && !result.contains("PASSED")) {
        System.out.println(result);
        throw new Error(result);
    } else {
        // Either the test passed or this platform is not supported.
        // On not supported platforms, we only expect the VM to
        // not crash during the test. This is especially important
        // on Windows where the detection of SOE in annotated
        // sections is implemented but the reserved zone mechanism
        // to avoid the corruption cannot be implemented yet
        // because of JDK-8067946
        System.out.println("PASSED");
    }
}