Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA3Intrinsics.java
41161 views
/*1* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2020, Huawei Technologies Co., Ltd. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/**25* @test26* @bug 825220427* @summary Verify that SHA3-224, SHA3-256, SHA3-384, SHA3-512 intrinsic is actually used.28*29* @library /test/lib /30* @modules java.base/jdk.internal.misc31* java.management32*33* @build sun.hotspot.WhiteBox34* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox35* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions36* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50037* -XX:Tier4InvocationThreshold=50038* -XX:+LogCompilation -XX:LogFile=positive_224.log39* -XX:CompileOnly=sun/security/provider/DigestBase40* -XX:CompileOnly=sun/security/provider/SHA341* -XX:+UseSHA3Intrinsics42* -Dalgorithm=SHA3-22443* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics44* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions45* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50046* -XX:Tier4InvocationThreshold=50047* -XX:+LogCompilation -XX:LogFile=negative_224.log48* -XX:CompileOnly=sun/security/provider/DigestBase49* -XX:CompileOnly=sun/security/provider/SHA350* -XX:-UseSHA3Intrinsics51* -Dalgorithm=SHA3-22452* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics53* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions54* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50055* -XX:Tier4InvocationThreshold=50056* -XX:+LogCompilation -XX:LogFile=positive_256.log57* -XX:CompileOnly=sun/security/provider/DigestBase58* -XX:CompileOnly=sun/security/provider/SHA359* -XX:+UseSHA3Intrinsics60* -Dalgorithm=SHA3-25661* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics62* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions63* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50064* -XX:Tier4InvocationThreshold=50065* -XX:+LogCompilation -XX:LogFile=negative_256.log66* -XX:CompileOnly=sun/security/provider/DigestBase67* -XX:CompileOnly=sun/security/provider/SHA368* -XX:-UseSHA3Intrinsics69* -Dalgorithm=SHA3-25670* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics71* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions72* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50073* -XX:Tier4InvocationThreshold=50074* -XX:+LogCompilation -XX:LogFile=positive_384.log75* -XX:CompileOnly=sun/security/provider/DigestBase76* -XX:CompileOnly=sun/security/provider/SHA377* -XX:+UseSHA3Intrinsics78* -Dalgorithm=SHA3-38479* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics80* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions81* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50082* -XX:Tier4InvocationThreshold=50083* -XX:+LogCompilation -XX:LogFile=negative_384.log84* -XX:CompileOnly=sun/security/provider/DigestBase85* -XX:CompileOnly=sun/security/provider/SHA386* -XX:-UseSHA3Intrinsics87* -Dalgorithm=SHA3-38488* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics89* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions90* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50091* -XX:Tier4InvocationThreshold=50092* -XX:+LogCompilation -XX:LogFile=positive_512.log93* -XX:CompileOnly=sun/security/provider/DigestBase94* -XX:CompileOnly=sun/security/provider/SHA395* -XX:+UseSHA3Intrinsics96* -Dalgorithm=SHA3-51297* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics98* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions99* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500100* -XX:Tier4InvocationThreshold=500101* -XX:+LogCompilation -XX:LogFile=negative_512.log102* -XX:CompileOnly=sun/security/provider/DigestBase103* -XX:CompileOnly=sun/security/provider/SHA3104* -XX:-UseSHA3Intrinsics105* -Dalgorithm=SHA3-512106* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics107* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE108* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log positive_384.log positive_512.log109* negative_224.log negative_256.log negative_384.log negative_512.log110*/111112package compiler.intrinsics.sha.sanity;113114import compiler.testlibrary.sha.predicate.IntrinsicPredicates;115116public class TestSHA3Intrinsics {117public static void main(String args[]) throws Exception {118new DigestSanityTestBase(IntrinsicPredicates.isSHA3IntrinsicAvailable(),119DigestSanityTestBase.SHA3_INTRINSIC_ID).test();120}121}122123124