From 73537725b145edeb369a1af78cb60a331ab3e36b Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sat, 1 Sep 2018 18:15:27 +0200 Subject: [PATCH] 8210259: [testbug] IncompatibleOptions.java fails if VM configured without ZGC Reviewed-by: pliden, kbarrett --- .../runtime/appcds/sharedStrings/IncompatibleOptions.java | 3 ++- test/lib/sun/hotspot/gc/GC.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java index 5861bc341c7..d6feb24a077 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java @@ -41,6 +41,7 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.code.Compiler; +import sun.hotspot.gc.GC; public class IncompatibleOptions { static final String COOPS_DUMP_WARNING = @@ -63,7 +64,7 @@ public class IncompatibleOptions { // Uncompressed OOPs testDump(1, "-XX:+UseG1GC", "-XX:-UseCompressedOops", COOPS_DUMP_WARNING, true); - if (Platform.isLinux() && Platform.isX64()) { + if (GC.Z.isSupported()) { // ZGC is included in build. testDump(1, "-XX:+UnlockExperimentalVMOptions", "-XX:+UseZGC", COOPS_DUMP_WARNING, true); } diff --git a/test/lib/sun/hotspot/gc/GC.java b/test/lib/sun/hotspot/gc/GC.java index 5b36d6a860d..bfc872097a4 100644 --- a/test/lib/sun/hotspot/gc/GC.java +++ b/test/lib/sun/hotspot/gc/GC.java @@ -31,7 +31,7 @@ import sun.hotspot.WhiteBox; */ public enum GC { /* - * Enum values much match CollectedHeap::Name + * Enum values must match CollectedHeap::Name */ Serial(1), Parallel(2), @@ -49,7 +49,7 @@ public enum GC { } /** - * @return true if this GC is supported by the VM + * @return true if this GC is supported by the VM, i.e., it is built into the VM. */ public boolean isSupported() { return WB.isGCSupported(name);