1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-lim2-details" } */
3 
4 struct { int x; int y; } global;
foo(int n)5 void foo(int n)
6 {
7   int i;
8   for ( i=0; i<n; i++)
9     global.y += global.x*global.x;
10 }
11 
12 /* { dg-final { scan-tree-dump "Executing store motion of global.y" "lim2" } } */
13 /* { dg-final { scan-tree-dump "Moving statement.*global.x.*out of loop 1" "lim2" } } */
14