On Tue, 3 Mar 2026 14:16:58 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> Yasumasa Suenaga has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Rename testcase
>
> Created PR: #30025
> 
> And also I update [JDK-8379039](https://bugs.openjdk.org/browse/JDK-8379039) 
> because it is labeled `process-violation-detected`. It's gone now.

@YaSuenag  The code comment above `CALL_LEAF_VECTOR` is very helpful, but 
because TestVectorLibraryUnaryOpAndBinaryOp.java doesn't contain guards to 
exclude platforms for which we don't build either libjsvml or libsleef, the 
test fails on, for instance, Windows/AArch64.

One option (although brittle) is to add a new property to VMProps.java that 
mimics the build rules for these two libraries and use that property as a 
precondition in the tests (see patch below).  The other option is to enable 
building libsleef on Windows/AArch64, but that's probably an invasive change.


diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT
index d1c72b9768c..1e9fe5ce699 100644
--- a/test/hotspot/jtreg/TEST.ROOT
+++ b/test/hotspot/jtreg/TEST.ROOT
@@ -76,6 +76,7 @@ requires.properties= \
     vm.hasSA \
     vm.hasJFR \
     vm.hasDTrace \
+    vm.hasVectorMathLib \
     vm.rtm.cpu \
     vm.rtm.compiler \
     vm.cds \
diff --git 
a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java
 
b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java
index f7837e1abfa..27cbc4ea154 100644
--- 
a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java
+++ 
b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java
@@ -32,6 +32,7 @@
  * @bug 8378312
  * @library /test/lib /
  * @summary VectorAPI: libraryUnaryOp and libraryBinaryOp should be 
intrinsified.
+ * @requires vm.hasVectorMathLib
  * @modules jdk.incubator.vector
  *
  * @run driver compiler.vectorapi.TestVectorLibraryUnaryOpAndBinaryOp
diff --git a/test/jtreg-ext/requires/VMProps.java 
b/test/jtreg-ext/requires/VMProps.java
index 70e619f3d3d..04ac8530603 100644
--- a/test/jtreg-ext/requires/VMProps.java
+++ b/test/jtreg-ext/requires/VMProps.java
@@ -116,6 +116,7 @@ public Map<String, String> call() {
         map.put("vm.hasJFR", this::vmHasJFR);
         map.put("vm.hasDTrace", this::vmHasDTrace);
         map.put("vm.jvmti", this::vmHasJVMTI);
+        map.put("vm.hasVectorMathLib", this::vmHasVectorMathLib);
         map.put("vm.cpu.features", this::cpuFeatures);
         map.put("vm.pageSize", this::vmPageSize);
         // vm.cds is true if the VM is compiled with cds support.
@@ -442,6 +443,17 @@ protected String vmHasDTrace() {
         return "" + WB.isDTraceIncluded();
     }
 
+    /**
+     * @return "true" if libsleef or libjsvml is built for the platform
+     */
+    protected String vmHasVectorMathLib() {
+        // See make/modules/jdk.incubator.vector/Lib.gmk for build rules
+        boolean isX64VectorMath = (Platform.isLinux() || Platform.isWindows()) 
&& Platform.isX64();
+        boolean isAArch64VectorMath = (Platform.isLinux() || Platform.isOSX()) 
&& Platform.isAArch64();
+        boolean isRiscv64VectorMath = Platform.isLinux() && 
Platform.isRISCV64();
+        return "" + (isX64VectorMath || isAArch64VectorMath || 
isRiscv64VectorMath);
+    }
+
     /**
      * Check for CDS support.
      *


Can you fix this please so that the test doesn't fail on Windows/AArch64?  
Thanks!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/29835#issuecomment-3993676075

Reply via email to