summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c')
-rw-r--r--gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c b/gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c
new file mode 100644
index 0000000000..418d5b20f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/vec-test-mask-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-O3 -mzarch -march=z13 -mzvector" } */
+
+/* { dg-final { scan-assembler-times "vtm" 2 } } */
+/* { dg-final { scan-assembler-times "ipm" 1 } } */
+
+#include <vecintrin.h>
+
+/* CC will be extracted into a GPR and returned. */
+int
+foo (vector unsigned int a, vector unsigned b)
+{
+ return vec_test_mask (a, b);
+}
+
+extern void baz (void);
+
+/* In that case the ipm/srl is supposed to optimized out by
+ combine/s390_canonicalize_comparison. */
+int
+bar (vector unsigned int a, vector unsigned b)
+{
+ if (vec_test_mask (a, b) == 2)
+ baz ();
+}