summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/cmp-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/cmp-2.c')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cmp-2.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/cmp-2.c b/gcc/testsuite/gcc.target/aarch64/cmp-2.c
new file mode 100644
index 00000000000..12016647061
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cmp-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int lt (int x, int y)
+{
+ if ((x - y) < 0)
+ return 10;
+
+ return 0;
+}
+
+int ge (int x, int y)
+{
+ if ((x - y) >= 0)
+ return 10;
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "csel\t" 2 } } */
+/* { dg-final { scan-assembler-not "sub\t" } } */