Add missing file
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 11 Oct 2016 08:55:31 +0000 (08:55 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 11 Oct 2016 08:55:31 +0000 (08:55 +0000)
From-SVN: r240972

gcc/testsuite/gcc.target/sparc/setcc-10.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/sparc/setcc-10.c b/gcc/testsuite/gcc.target/sparc/setcc-10.c
new file mode 100644 (file)
index 0000000..7d75e48
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O1 -msubxc" } */
+
+long foo2 (long a, long i)
+{
+  return a - (i != 0);
+}
+
+long foo4 (long a, long b, long i)
+{
+  return a - b - (i != 0);
+}
+
+long foo5 (long a, long i)
+{
+  return a + (i == 0);
+}
+
+/* { dg-final { scan-assembler-times "subxc\t%" 3 } } */
+/* { dg-final { scan-assembler-times "cmp\t%" 3 } } */
+/* { dg-final { scan-assembler-not "add\t%" } } */
+/* { dg-final { scan-assembler-not "sub\t%" } } */