aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/loop-7.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f04e498..36592ab 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-17 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR rtl-optimization/31360
+ * gcc.dg/loop-7.c: New test.
+
2007-04-17 Mark Mitchell <mark@codesourcery.com>
* gcc.misc-tests/linkage.exp: Do not run on remote hosts.
diff --git a/gcc/testsuite/gcc.dg/loop-7.c b/gcc/testsuite/gcc.dg/loop-7.c
new file mode 100644
index 0000000..0457add
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-7.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/31360 */
+
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
+
+void f(int *a)
+{
+ int i;
+ for (i = 0;i<100;i++)
+ a[i] = 0;
+}
+
+/* Load of 0 is moved out of the loop. */
+/* { dg-final { scan-rtl-dump-times "Decided" 1 "loop2_invariant" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_invariant" } } */
+