< prev index next >

test/hotspot/jtreg/gc/CriticalNativeArgs.java

Print this page
rev 53506 : Fix indentation of CriticalNative* tests


  23 
  24 
  25 /*
  26  * @test CriticalNativeStress
  27  * @key gc
  28  * @bug 8199868
  29  * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Epsilon & !vm.graal.enabled
  30  * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Shenandoah & !vm.graal.enabled
  31  * @summary test argument unpacking nmethod wrapper of critical native method
  32  * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs
  33  *
  34  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive    -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  35  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive    -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  36  *
  37  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  38  *
  39  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC                                                                        -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs
  40  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=traversal  -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  41  */
  42 public class CriticalNativeArgs {
  43   static {
  44     System.loadLibrary("CriticalNative");
  45   }
  46 
  47   static native boolean isNull(int[] a);
  48 
  49   public static void main(String[] args) {
  50     int[] arr = new int[2];
  51 
  52     if (isNull(arr)) {
  53       throw new RuntimeException("Should not be null");
  54     }
  55 
  56     if (!isNull(null)) {
  57       throw new RuntimeException("Should be null");

  58     }
  59   }
  60 }
  61 


  23 
  24 
  25 /*
  26  * @test CriticalNativeStress
  27  * @key gc
  28  * @bug 8199868
  29  * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Epsilon & !vm.graal.enabled
  30  * @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64") & vm.gc.Shenandoah & !vm.graal.enabled
  31  * @summary test argument unpacking nmethod wrapper of critical native method
  32  * @run main/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs
  33  *
  34  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive    -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  35  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive    -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  36  *
  37  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  38  *
  39  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC                                                                        -Xcomp -Xmx256M -XX:+CriticalJNINatives CriticalNativeArgs
  40  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=traversal  -Xcomp -Xmx512M -XX:+CriticalJNINatives CriticalNativeArgs
  41  */
  42 public class CriticalNativeArgs {
  43     static {
  44         System.loadLibrary("CriticalNative");
  45     }
  46 
  47     static native boolean isNull(int[] a);
  48 
  49     public static void main(String[] args) {
  50         int[] arr = new int[2];
  51 
  52         if (isNull(arr)) {
  53             throw new RuntimeException("Should not be null");
  54         }
  55 
  56         if (!isNull(null)) {
  57             throw new RuntimeException("Should be null");
  58         }
  59     }

  60 }
  61 
< prev index next >