S/390: Vector base support - testcases
[gcc.git] / gcc / testsuite / gcc.target / s390 / s390.exp
index 431e2c049b57fcc240f8284e1a5af4054fd37f1c..eb1d73b5fbf337f4c3dccc054c653e6585a1c409 100644 (file)
@@ -37,6 +37,21 @@ proc check_effective_target_htm { } {
     }] "-march=zEC12 -mzarch" ] } { return 0 } else { return 1 }
 }
 
+# Return 1 if vector (va - vector add) instructions are understood by
+# the assembler and can be executed.  This also covers checking for
+# the VX kernel feature.  A kernel without that feature does not
+# enable the vector facility and the following check will die with a
+# signal.
+proc check_effective_target_vector { } {
+    if { ![check_runtime s390_check_vector [subst {
+       int main (void)
+       {
+           asm ("va %%v24, %%v26, %%v28, 3" : : : "v24", "v26", "v28");
+           return 0;
+       }
+    }] "-march=z13 -mzarch" ] } { return 0 } else { return 1 }
+}
+
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CFLAGS
 if ![info exists DEFAULT_CFLAGS] then {
@@ -50,5 +65,8 @@ dg-init
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
        "" $DEFAULT_CFLAGS
 
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.\[cS\]]] \
+       "" $DEFAULT_CFLAGS
+
 # All done.
 dg-finish