[6/6] S/390: Add test for noce_convert_multiple_sets.

Message ID 20181114130752.5057-7-rdapp@linux.ibm.com
State New
Headers show
Series
  • If conversion with multiple sets.
Related show

Commit Message

Robin Dapp Nov. 14, 2018, 1:07 p.m.
New test.

--

gcc/testsuite/ChangeLog:

2018-11-14  Robin Dapp  <rdapp@linux.ibm.com>

	* gcc.target/s390/ifcvt-two-insns-int.c: New test.
---
 .../gcc.target/s390/ifcvt-two-insns-int.c     | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c

-- 
2.17.0

Patch

diff --git a/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c
new file mode 100644
index 00000000000..952c8fd890e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c
@@ -0,0 +1,26 @@ 
+/* Check load on condition for bool.  */
+
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-O2 -march=z13" } */
+
+/* { dg-final { scan-assembler "lochinhe\t%r.?,1" } } */
+/* { dg-final { scan-assembler "locrhe\t.*" } } */
+#include <stdbool.h>
+
+int foo (int *a, unsigned int n)
+{
+  int min = 999999;
+  int bla = 0;
+  for (int i = 0; i < n; i++)
+    {
+      if (a[i] < min)
+	{
+	  min = a[i];
+	  bla = 1;
+	}
+    }
+
+  if (bla)
+    min += 1;
+  return min;
+}