1 /*
  2  * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2020, 2023 SAP SE. 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 /*
 27  * Note: This runs the metaspace-related parts of gtest in configurations which
 28  *  are not tested explicitly in the standard gtests.
 29  *
 30  */
 31 
 32 /* @test id=default-debug
 33  * @bug 8251158
 34  * @summary Run metaspace-related gtests with all default but verifications enabled
 35  * @library /test/lib
 36  * @modules java.base/jdk.internal.misc
 37  *          java.xml
 38  * @requires vm.debug
 39  * @requires vm.flagless
 40  * @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:VerifyMetaspaceInterval=3
 41  */
 42 
 43 
 44 
 45 
 46 /* @test id=reclaim-aggressive-debug
 47  * @bug 8251158
 48  * @summary Run metaspace-related gtests for reclaim policy aggressive (with verifications)
 49  * @library /test/lib
 50  * @modules java.base/jdk.internal.misc
 51  *          java.xml
 52  * @requires vm.debug
 53  * @requires vm.flagless
 54  * @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=aggressive -XX:VerifyMetaspaceInterval=3
 55  */
 56 
 57 /* @test id=reclaim-aggressive-ndebug
 58  * @bug 8251158
 59  * @summary Run metaspace-related gtests for reclaim policy aggressive
 60  * @library /test/lib
 61  * @modules java.base/jdk.internal.misc
 62  *          java.xml
 63  * @requires vm.debug == false
 64  * @requires vm.flagless
 65  * @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=aggressive
 66  */
 67 
 68 
 69 
 70 
 71 /* @test id=balanced-with-guards
 72  * @summary Run metaspace-related gtests with allocation guards enabled
 73  * @library /test/lib
 74  * @modules java.base/jdk.internal.misc
 75  *          java.xml
 76  * @requires vm.debug
 77  * @requires vm.flagless
 78  * @run main/native GTestWrapper --gtest_filter=metaspace* -XX:VerifyMetaspaceInterval=3 -XX:+MetaspaceGuardAllocations
 79  */
 80 
 81 
 82 
 83 
 84 /* @test id=balanced-no-ccs
 85  * @summary Run metaspace-related gtests with compressed class pointers off
 86  * @library /test/lib
 87  * @modules java.base/jdk.internal.misc
 88  *          java.xml
 89  * @requires vm.bits == 64
 90  * @requires vm.flagless
 91  * @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=balanced -XX:-UseCompressedClassPointers
 92  */
 93 
 94 
 95 /* @test id=ccs-on-compact-headers-on
 96  * @summary Run with +UseCCS and +UseCompactObjectHeaders
 97  * @library /test/lib
 98  * @modules java.base/jdk.internal.misc
 99  *          java.xml
100  * @requires vm.bits == 64
101  * @requires vm.flagless
102  * @run main/native GTestWrapper --gtest_filter=metaspace* -Xlog:metaspace* -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseCompressedClassPointers -XX:VerifyMetaspaceInterval=3
103  */
104 
105 /* @test id=ccs-on-compact-headers-off
106  * @summary Run with +UseCCS and -UseCompactObjectHeaders
107  * @library /test/lib
108  * @modules java.base/jdk.internal.misc
109  *          java.xml
110  * @requires vm.bits == 64
111  * @requires vm.flagless
112  * @run main/native GTestWrapper --gtest_filter=metaspace* -Xlog:metaspace* -XX:+UnlockExperimentalVMOptions -XX:-UseCompactObjectHeaders -XX:+UseCompressedClassPointers -XX:VerifyMetaspaceInterval=3
113  */
114 
115 /* @test id=ccs-off
116  * @summary Run with -UseCCS
117  * @library /test/lib
118  * @modules java.base/jdk.internal.misc
119  *          java.xml
120  * @requires vm.bits == 64
121  * @requires vm.flagless
122  * @run main/native GTestWrapper --gtest_filter=metaspace* -Xlog:metaspace* -XX:-UseCompressedClassPointers -XX:VerifyMetaspaceInterval=3
123  */
124 
125 
126