1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-require-effective-target ilp32 } */
3 /* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-aprefetch-details" } */
5 /* These are common idioms for writing variable-length arrays at the end
6 of structures. We should not deduce anything about the number of iterations
7 of the loops from them. */
15 int loop0 (int n, struct tail0 *x)
19 for (i = 0; i < n; i++)
30 int loop1 (int n, struct tail1 *x)
34 for (i = 0; i < n; i++)
40 /* It is unlikely that this should be a tail array. We may deduce that most
41 likely, the loop iterates about 5 times, and the array is not worth prefetching. */
48 int loop5 (int n, struct tail5 *x)
52 for (i = 0; i < n; i++)
58 /* { dg-final { scan-tree-dump-times "Issued prefetch" 2 "aprefetch" } } */
59 /* { dg-final { scan-tree-dump-times "Not prefetching" 1 "aprefetch" } } */
60 /* { dg-final { cleanup-tree-dump "aprefetch" } } */