summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
blob: 85800588dc2b628a5df8fbc9d334ad090e37761b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-lim-details" } */

struct { int x; int y; } global;
void foo(int n)
{
  int i;
  for ( i=0; i<n; i++)
    global.y += global.x*global.x;
}

/* { dg-final { scan-tree-dump "Executing store motion of global.y" "lim1" } } */
/* { dg-final { scan-tree-dump "Moving statement.*global.x.*out of loop 1" "lim1" } } */
/* { dg-final { cleanup-tree-dump "lim\[1-2\]" } } */