--- old/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup/LookUp.java 2017-11-22 17:38:00.673792069 +0300 +++ new/test/hotspot/jtreg/compiler/runtime/criticalnatives/lookup/LookUp.java 2017-11-22 17:38:00.477788085 +0300 @@ -24,10 +24,16 @@ /* @test * @bug 8167408 - * @run main/othervm/native -Xcomp compiler.runtime.criticalnatives.lookup.LookUp + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp compiler.runtime.criticalnatives.lookup.LookUp */ package compiler.runtime.criticalnatives.lookup; +import sun.hotspot.WhiteBox; public class LookUp { + private static final boolean CRITICAL_JNI_ON = WhiteBox.getWhiteBox().getBooleanVMFlag("CriticalJNINatives"); static { System.loadLibrary("CNLookUp"); } @@ -49,6 +55,7 @@ check(result[0]); } private static void check(byte result) throws Exception { + if (!CRITICAL_JNI_ON) return; // just check that VM doesn't crash if (result != 2) { if (result == 1) { throw new Exception("critical native arguments mismatch");