Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
41161 views
/*1* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24* @test25* @bug 803596826* @summary Verify that SHA-256 intrinsic is actually used.27*28* @library /test/lib /29* @modules java.base/jdk.internal.misc30* java.management31*32* @build sun.hotspot.WhiteBox33* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox34* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions35* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50036* -XX:Tier4InvocationThreshold=50037* -XX:+LogCompilation -XX:LogFile=positive_224.log38* -XX:CompileOnly=sun/security/provider/DigestBase39* -XX:CompileOnly=sun/security/provider/SHA240* -XX:+UseSHA256Intrinsics41* -Dalgorithm=SHA-22442* compiler.intrinsics.sha.sanity.TestSHA256Intrinsics43* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions44* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50045* -XX:Tier4InvocationThreshold=50046* -XX:+LogCompilation -XX:LogFile=negative_224.log47* -XX:CompileOnly=sun/security/provider/DigestBase48* -XX:CompileOnly=sun/security/provider/SHA249* -XX:-UseSHA256Intrinsics50* -Dalgorithm=SHA-22451* compiler.intrinsics.sha.sanity.TestSHA256Intrinsics52* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions53* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50054* -XX:Tier4InvocationThreshold=50055* -XX:+LogCompilation -XX:LogFile=positive_256.log56* -XX:CompileOnly=sun/security/provider/DigestBase57* -XX:CompileOnly=sun/security/provider/SHA258* -XX:+UseSHA256Intrinsics59* -Dalgorithm=SHA-25660* compiler.intrinsics.sha.sanity.TestSHA256Intrinsics61* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions62* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50063* -XX:Tier4InvocationThreshold=50064* -XX:+LogCompilation -XX:LogFile=negative_256.log65* -XX:CompileOnly=sun/security/provider/DigestBase66* -XX:CompileOnly=sun/security/provider/SHA267* -XX:-UseSHA256Intrinsics68* -Dalgorithm=SHA-25669* compiler.intrinsics.sha.sanity.TestSHA256Intrinsics70* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE71* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log72* negative_224.log negative_256.log73*/7475package compiler.intrinsics.sha.sanity;7677import compiler.testlibrary.sha.predicate.IntrinsicPredicates;7879public class TestSHA256Intrinsics {80public static void main(String args[]) throws Exception {81new DigestSanityTestBase(IntrinsicPredicates.isSHA256IntrinsicAvailable(),82DigestSanityTestBase.SHA256_INTRINSIC_ID).test();83}84}858687