PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-18.c
blob93eccf1b16fd88fb5d52e4e2b91233dca5a365d4
1 /* A test for # of iterations estimation. We know that I does not overflow,
2 thus we can perform strength reduction (even though the 32-bit variable
3 i is first extended to 64-bit type). */
5 /* { dg-options "-O2 -fdump-tree-optimized" } */
6 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
8 unsigned bar(void);
10 void foo(unsigned *p, unsigned n)
12 unsigned i;
14 for (i = 0; i < n; i++)
15 p[i] = bar ();
18 /* Check that the memory reference was replaced with MEM, and that there is no
19 multiplication. */
21 /* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
22 /* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */