diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 9717da05522..964c33bc57c 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -78,6 +78,7 @@ requires.properties= \ vm.cds \ vm.cds.default.archive.available \ vm.cds.nocoops.archive.available \ + vm.cds.nocoh.archive.available \ vm.cds.custom.loaders \ vm.cds.supports.aot.class.linking \ vm.cds.supports.aot.code.caching \ diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java index fdcc35685d2..ff4fb265528 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Red Hat. All rights reserved. + * Copyright (c) 2023, 2026, Red Hat. All rights reserved. * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,6 +29,7 @@ * @requires vm.flagless * @requires vm.cds * @requires vm.cds.default.archive.available + * @requires vm.cds.nocoh.archive.available * @requires (os.family != "windows") & (os.family != "aix") * @library /test/lib * @modules java.base/jdk.internal.misc diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 297bc6a9f5b..d8c279781b5 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -119,6 +119,7 @@ public class VMProps implements Callable> { map.put("vm.cds", this::vmCDS); map.put("vm.cds.default.archive.available", this::vmCDSDefaultArchiveAvailable); map.put("vm.cds.nocoops.archive.available", this::vmCDSNocoopsArchiveAvailable); + map.put("vm.cds.nocoh.archive.available", this::vmCDSNocohArchiveAvailable); map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders); map.put("vm.cds.supports.aot.class.linking", this::vmCDSSupportsAOTClassLinking); map.put("vm.cds.supports.aot.code.caching", this::vmCDSSupportsAOTCodeCaching); @@ -418,6 +419,16 @@ public class VMProps implements Callable> { return "" + ("true".equals(vmCDS()) && Files.exists(archive)); } + /** + * Check for CDS no compact object headers archive existence. + * + * @return true if CDS archive classes_nocoh.jsa exists in the JDK to be tested. + */ + protected String vmCDSNocohArchiveAvailable() { + Path archive = Paths.get(System.getProperty("java.home"), "lib", "server", "classes_nocoh.jsa"); + return "" + ("true".equals(vmCDS()) && Files.exists(archive)); + } + /** * Check for CDS support for custom loaders. *