aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ppc-fsel-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ppc-fsel-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/ppc-fsel-3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ppc-fsel-3.c b/gcc/testsuite/gcc.dg/ppc-fsel-3.c
new file mode 100644
index 00000000000..1d07c528eb1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ppc-fsel-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O -mpowerpc-gfxopt" } */
+/* { dg-final { scan-assembler-not "fsub" } } */
+
+/* Check that an fsub isn't generated when no arithmetic was requested;
+ such an fsub might incorrectly set floating-point exception flags. */
+
+double foo(double a, double b, double c, double d)
+{
+ return a < b ? c : d;
+}