aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-22.c
blob: afc792f6503eb4b2d878b69134cfa6753b4b6da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* { dg-do run } */
/* { dg-options "-O3 -fdump-tree-ldist-details" } */

extern void abort (void);

int a[1024], b[1024];

void __attribute__((noinline,noclone))
foo (void)
{
  int i;
  for (i = 0; i < 1024; ++i)
    {
      a[i] = 0;
      if (i > 100)
	b[i] = i;
    }
}

int main()
{
  b[100] = 1;
  foo ();
  if (b[100] != 1 || b[101] != 101)
    abort ();
  if (a[0] != 0 || a[101] != 0)
    abort ();
  return 0;
}

/* { dg-final { scan-tree-dump "generated memset zero" "ldist" } } */
/* { dg-final { cleanup-tree-dump "ldist" } } */