Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.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 multi block 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:+UseSHA256Intrinsics -XX:-UseMD5Intrinsics41* -XX:-UseSHA1Intrinsics -XX:-UseSHA512Intrinsics42* -Dalgorithm=SHA-22443* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics44* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions45* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50046* -XX:Tier4InvocationThreshold=50047* -XX:+LogCompilation -XX:LogFile=positive_224_def.log48* -XX:CompileOnly=sun/security/provider/DigestBase49* -XX:CompileOnly=sun/security/provider/SHA250* -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-22451* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics52* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions53* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50054* -XX:Tier4InvocationThreshold=50055* -XX:+LogCompilation -XX:LogFile=negative_224.log56* -XX:CompileOnly=sun/security/provider/DigestBase57* -XX:CompileOnly=sun/security/provider/SHA2 -XX:-UseSHA58* -Dalgorithm=SHA-22459* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics60* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions61* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50062* -XX:Tier4InvocationThreshold=50063* -XX:+LogCompilation -XX:LogFile=positive_256.log64* -XX:CompileOnly=sun/security/provider/DigestBase65* -XX:CompileOnly=sun/security/provider/SHA266* -XX:+UseSHA256Intrinsics -XX:-UseMD5Intrinsics67* -XX:-UseSHA1Intrinsics -XX:-UseSHA512Intrinsics68* -Dalgorithm=SHA-25669* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics70* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions71* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50072* -XX:Tier4InvocationThreshold=50073* -XX:+LogCompilation -XX:LogFile=positive_256_def.log74* -XX:CompileOnly=sun/security/provider/DigestBase75* -XX:CompileOnly=sun/security/provider/SHA76* -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-25677* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics78* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions79* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50080* -XX:Tier4InvocationThreshold=50081* -XX:+LogCompilation -XX:LogFile=negative_256.log82* -XX:CompileOnly=sun/security/provider/DigestBase83* -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA84* -Dalgorithm=SHA-25685* compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics86* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE87* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log88* positive_224_def.log positive_256_def.log negative_224.log89* negative_256.log90*/9192package compiler.intrinsics.sha.sanity;93import compiler.testlibrary.sha.predicate.IntrinsicPredicates;9495public class TestSHA256MultiBlockIntrinsics {96public static void main(String args[]) throws Exception {97new DigestSanityTestBase(IntrinsicPredicates.isSHA256IntrinsicAvailable(),98DigestSanityTestBase.MB_INTRINSIC_ID).test();99}100}101102103