Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA3Intrinsics.java
41161 views
1
/*
2
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3
* Copyright (c) 2020, Huawei Technologies Co., Ltd. All rights reserved.
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
*
6
* This code is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 2 only, as
8
* published by the Free Software Foundation.
9
*
10
* This code is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* version 2 for more details (a copy is included in the LICENSE file that
14
* accompanied this code).
15
*
16
* You should have received a copy of the GNU General Public License version
17
* 2 along with this work; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
* or visit www.oracle.com if you need additional information or have any
22
* questions.
23
*/
24
25
/**
26
* @test
27
* @bug 8252204
28
* @summary Verify that SHA3-224, SHA3-256, SHA3-384, SHA3-512 intrinsic is actually used.
29
*
30
* @library /test/lib /
31
* @modules java.base/jdk.internal.misc
32
* java.management
33
*
34
* @build sun.hotspot.WhiteBox
35
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
36
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
37
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
38
* -XX:Tier4InvocationThreshold=500
39
* -XX:+LogCompilation -XX:LogFile=positive_224.log
40
* -XX:CompileOnly=sun/security/provider/DigestBase
41
* -XX:CompileOnly=sun/security/provider/SHA3
42
* -XX:+UseSHA3Intrinsics
43
* -Dalgorithm=SHA3-224
44
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
45
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
46
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
47
* -XX:Tier4InvocationThreshold=500
48
* -XX:+LogCompilation -XX:LogFile=negative_224.log
49
* -XX:CompileOnly=sun/security/provider/DigestBase
50
* -XX:CompileOnly=sun/security/provider/SHA3
51
* -XX:-UseSHA3Intrinsics
52
* -Dalgorithm=SHA3-224
53
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
54
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
55
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
56
* -XX:Tier4InvocationThreshold=500
57
* -XX:+LogCompilation -XX:LogFile=positive_256.log
58
* -XX:CompileOnly=sun/security/provider/DigestBase
59
* -XX:CompileOnly=sun/security/provider/SHA3
60
* -XX:+UseSHA3Intrinsics
61
* -Dalgorithm=SHA3-256
62
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
63
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
64
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
65
* -XX:Tier4InvocationThreshold=500
66
* -XX:+LogCompilation -XX:LogFile=negative_256.log
67
* -XX:CompileOnly=sun/security/provider/DigestBase
68
* -XX:CompileOnly=sun/security/provider/SHA3
69
* -XX:-UseSHA3Intrinsics
70
* -Dalgorithm=SHA3-256
71
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
72
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
73
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
74
* -XX:Tier4InvocationThreshold=500
75
* -XX:+LogCompilation -XX:LogFile=positive_384.log
76
* -XX:CompileOnly=sun/security/provider/DigestBase
77
* -XX:CompileOnly=sun/security/provider/SHA3
78
* -XX:+UseSHA3Intrinsics
79
* -Dalgorithm=SHA3-384
80
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
81
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
82
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
83
* -XX:Tier4InvocationThreshold=500
84
* -XX:+LogCompilation -XX:LogFile=negative_384.log
85
* -XX:CompileOnly=sun/security/provider/DigestBase
86
* -XX:CompileOnly=sun/security/provider/SHA3
87
* -XX:-UseSHA3Intrinsics
88
* -Dalgorithm=SHA3-384
89
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
90
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
91
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
92
* -XX:Tier4InvocationThreshold=500
93
* -XX:+LogCompilation -XX:LogFile=positive_512.log
94
* -XX:CompileOnly=sun/security/provider/DigestBase
95
* -XX:CompileOnly=sun/security/provider/SHA3
96
* -XX:+UseSHA3Intrinsics
97
* -Dalgorithm=SHA3-512
98
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
99
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
100
* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
101
* -XX:Tier4InvocationThreshold=500
102
* -XX:+LogCompilation -XX:LogFile=negative_512.log
103
* -XX:CompileOnly=sun/security/provider/DigestBase
104
* -XX:CompileOnly=sun/security/provider/SHA3
105
* -XX:-UseSHA3Intrinsics
106
* -Dalgorithm=SHA3-512
107
* compiler.intrinsics.sha.sanity.TestSHA3Intrinsics
108
* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
109
* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log positive_384.log positive_512.log
110
* negative_224.log negative_256.log negative_384.log negative_512.log
111
*/
112
113
package compiler.intrinsics.sha.sanity;
114
115
import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
116
117
public class TestSHA3Intrinsics {
118
public static void main(String args[]) throws Exception {
119
new DigestSanityTestBase(IntrinsicPredicates.isSHA3IntrinsicAvailable(),
120
DigestSanityTestBase.SHA3_INTRINSIC_ID).test();
121
}
122
}
123
124