diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-09 23:20:13 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-09 23:20:13 +0000 |
commit | 4432a4e210b1a98abdebff2f1bd3555af2144d72 (patch) | |
tree | 3dd34a8c34793776e40587f22f12789ab230d69d /gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c | |
parent | 2e53aef54d8a8913c011eb1567d3b82921628ba3 (diff) |
This commit was manufactured by cvs2svn to create tagapple/gcc-5000
'apple-gcc-5000'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-5000@96220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c new file mode 100644 index 00000000000..c9fc2003ec7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c @@ -0,0 +1,38 @@ +/* APPLE LOCAL file lno */ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-optimize -funroll-loops -fdump-tree-optimized" } */ + +void foo(void) +{ + int n = 16875; + + while (n) + { + if (n&1) + bar (n); + n >>= 1; + } +} + +static inline int power (long x, unsigned int n) +{ + long y = n % 2 ? x : 1; + + while (n >>= 1) + { + x = x * x; + if (n % 2) + y = y * x; + } + + return y; +} + +void test(long x) +{ + bar (power (x, 10)); + bar (power (x, 27)); +} + +/* All loops should be completely unrolled, so there should be no labels. */ +/* { dg-final { scan-tree-dump-times "<L" 0 "optimized"} } */ |