aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c b/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c
new file mode 100644
index 000000000..cb8d00762
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c
@@ -0,0 +1,19 @@
+/* PR optimization/10157 */
+/* Originator: Peter van Hoof <p.van-hoof@qub.ac.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+/* Verify that the loop optimizer doesn't
+ emit invalid reg-to-reg copy insns. */
+
+void g() {
+ while(1) {
+ int i,n;
+ double p,r;
+ for( i=0; i < n; i++ )
+ if( p > 1. )
+ for( i=0; i < n; i++ )
+ r += 2.;
+ }
+}