1 /* { dg-do compile } */
2 /* { dg-options "-O -fprofile-arcs -fprofile-update=single -fdump-tree-lim2-details" } */
3 /* { dg-require-profiling "-fprofile-generate" } */
4 
5 struct thread_param
6 {
7   long* buf;
8   long iterations;
9   long accesses;
10 } param;
11 
access_buf(struct thread_param * p)12 void access_buf(struct thread_param* p)
13 {
14   long i,j;
15   long iterations = p->iterations;
16   long accesses = p->accesses;
17   for (i=0; i<iterations; i++)
18     {
19       long* pbuf = p->buf;
20       for (j=0; j<accesses; j++)
21 	pbuf[j] += 1;
22     }
23 }
24 
25 /* { dg-final { scan-tree-dump-times "Executing store motion of __gcov0.access_buf\\\[\[12\]\\\] from loop 1" 2 "lim2" } } */
26