8210259: [testbug] IncompatibleOptions.java fails if VM configured without ZGC
authorgoetz
Sat, 01 Sep 2018 18:15:27 +0200
changeset 51616 b071f4fff1f1
parent 51615 afbb33428df7
child 51617 9720ad0a40b6
8210259: [testbug] IncompatibleOptions.java fails if VM configured without ZGC Reviewed-by: pliden, kbarrett
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java
test/lib/sun/hotspot/gc/GC.java
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Fri Aug 31 14:54:42 2018 -0700
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Sat Sep 01 18:15:27 2018 +0200
@@ -41,6 +41,7 @@
 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 @@
 
         // 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);
         }
 
--- a/test/lib/sun/hotspot/gc/GC.java	Fri Aug 31 14:54:42 2018 -0700
+++ b/test/lib/sun/hotspot/gc/GC.java	Sat Sep 01 18:15:27 2018 +0200
@@ -31,7 +31,7 @@
  */
 public enum GC {
     /*
-     * Enum values much match CollectedHeap::Name
+     * Enum values must match CollectedHeap::Name
      */
     Serial(1),
     Parallel(2),
@@ -49,7 +49,7 @@
     }
 
     /**
-     * @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);