aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c
new file mode 100644
index 000000000..31fcc9f8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+int a;
+
+int foo(int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = a;
+ a = 9;
+ }
+ return d + e;
+}
+
+/* We will move the load of a out of the loop. */
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */