8264983: Add gtest for JDK-8264008
Reviewed-by: stuefe
This commit is contained in:
parent
91b08b733e
commit
a22ad03b25
@ -73,3 +73,18 @@ TEST_VM(MetaspaceUtils, committed_compressed_class_pointers) {
|
||||
EXPECT_LE(committed_class, committed);
|
||||
}
|
||||
|
||||
TEST_VM(MetaspaceUtils, non_compressed_class_pointers) {
|
||||
if (UseCompressedClassPointers) {
|
||||
return;
|
||||
}
|
||||
|
||||
size_t committed_class = MetaspaceUtils::committed_bytes(Metaspace::ClassType);
|
||||
EXPECT_EQ(committed_class, 0UL);
|
||||
|
||||
size_t used_class = MetaspaceUtils::used_bytes(Metaspace::ClassType);
|
||||
EXPECT_EQ(used_class, 0UL);
|
||||
|
||||
size_t reserved_class = MetaspaceUtils::reserved_bytes(Metaspace::ClassType);
|
||||
EXPECT_EQ(reserved_class, 0UL);
|
||||
}
|
||||
|
||||
|
40
test/hotspot/jtreg/gtest/MetaspaceUtilsGtests.java
Normal file
40
test/hotspot/jtreg/gtest/MetaspaceUtilsGtests.java
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note: This runs the metaspace utils related parts of gtest in configurations which
|
||||
* are not tested explicitly in the standard gtests.
|
||||
*
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 8264008
|
||||
* @summary Run metaspace utils related gtests with compressed class pointers off
|
||||
* @requires vm.bits == 64
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.xml
|
||||
* @requires vm.flagless
|
||||
* @run main/native GTestWrapper --gtest_filter=MetaspaceUtils* -XX:-UseCompressedClassPointers
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user