summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr92301.c
blob: 3ade201ad9024b2e97041b660a7e266aeafdc49b (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
33
34
35
/* { dg-do run } */
/* { dg-options "-O3" } */

unsigned int m;

#define N 128
unsigned int a[N];

unsigned int
__attribute__((noipa))
df_count_refs (_Bool include_defs)
{
  int size = 0;

  for (unsigned int regno = 0; regno < m; regno++)
    if (include_defs)
      size += a[regno];
  return size;
}

int main(int argc, char **argv)
{
  for (unsigned i = 0; i < N; i++)
    a[i] = i;

  if (argc < 2)
    m = 17;

  unsigned int r = df_count_refs(1);
  __builtin_printf ("r: %d\n", r);
  if (r != 136)
    __builtin_abort ();

  return 0;
}