< prev index next >

test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template

Print this page
*** 482,10 ***
--- 482,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, $vectorteststype$::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompress$vectorteststype$SmokeTest(IntFunction<boolean[]> fa) {
+         int trueCount = 0;
+         boolean[] a = fa.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 var vmask = SPECIES.loadMask(a, i);
+                 trueCount = vmask.trueCount();
+                 var rmask = vmask.compress();
+                 for (int j = 0; j < SPECIES.length(); j++)  {
+                     Assert.assertEquals(rmask.laneIsSet(j), j < trueCount);
+                 }
+             }
+         }
+     }
+ 
  #if[!MaxBit]
      @DataProvider
      public static Object[][] longMaskProvider() {
          return new Object[][]{
                  {0xFFFFFFFFFFFFFFFFL},
< prev index next >