diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 93aa08ae7a7..5a99e5a8b30 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-09-24 Zdenek Dvorak + Adam Nemet + + * gcc.dg/tree-ssa/ivopts-1.c: New test. + * gcc.dg/tree-ssa/ivopts-2.c: New test. + 2006-09-24 Kazu Hirata PR target/28911 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c new file mode 100644 index 00000000000..5ee87b033b1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ + +/* Not all platforms support TImode integers. */ +#if defined(__LP64__) && !defined(__hppa__) +typedef int TItype __attribute__ ((mode (TI))); +#else +typedef long TItype; +#endif + +TItype last_data_offset ; +int store; +char *data; + +f () +{ + + TItype data_offset = last_data_offset; + char *p; + + for (p = data; *p; p++) + { + data_offset++; + g (data_offset); + store = data_offset + 1; + } +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c new file mode 100644 index 00000000000..05c62bdc659 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ivopts-details" } */ + +long last_data_offset; +int store; +char *data; + +f () +{ + + long data_offset = last_data_offset; + char *p; + + for (p = data; *p; p++) + { + data_offset++; + g (data_offset); + store = data_offset + 1; + } +} + +/* We should only have two IVs. */ +/* { dg-final { scan-tree-dump-not "\\n candidates .*,.*,.*\\n\[^\\n\]*\\nFinal cost" "ivopts" } } */ +/* { dg-final { cleanup-tree-dump "ivopts" } } */