aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ultrasp11.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ultrasp11.c')
-rw-r--r--gcc/testsuite/gcc.dg/ultrasp11.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ultrasp11.c b/gcc/testsuite/gcc.dg/ultrasp11.c
new file mode 100644
index 00000000000..8f279f721ae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ultrasp11.c
@@ -0,0 +1,25 @@
+/* PR target/17245 */
+/* Origin: <aaronw@net.com> */
+/* Testcase by Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de> */
+/* { dg-do compile { target sparc*-*-* } } */
+/* { dg-options "-O -mcpu=v9" } */
+
+/* This used to fail on 32-bit Ultrasparc because reload was emitting
+ a move insn that doesn't satisfy its constraints. */
+
+int n;
+double range ;
+double bin ;
+double wmean;
+
+double f ()
+{
+ int i ;
+ long double W = 0 ;
+ for ( i = 0 ; i < n ; i ++) {
+ double xi = range;
+ double wi = bin;
+ W += wi ;
+ wmean += ( xi - wmean) * ( wi / W);
+ }
+}