summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/cmov3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/cmov3.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/cmov3.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/cmov3.c b/gcc/testsuite/gcc.target/i386/cmov3.c
new file mode 100644
index 00000000000..6ef2675297d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/cmov3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=k8" } */
+/* { dg-final { scan-assembler "cmov" } } */
+
+/* This conditional move is fastest to be done using cmov. */
+t(int a, int b)
+{
+ return (a<=b?5:-5);
+}