aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/graphite/pr106055.c
blob: 22be62b360740647e4bd87a0b5430ddd2bcd90d9 (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
36
37
38
39
40
41
/* { dg-do compile } */
/* { dg-options "-Os -floop-parallelize-all -fno-tree-dce" } */

__attribute__ ((returns_twice)) int
bar (void);

void
quux (void);

void
empty (void)
{
}

unsigned int
choose (unsigned int x, unsigned int y)
{
  return y ? x : 0;
}

int
foo (int *p, unsigned int x, int y)
{
  unsigned int acc = 0;

  empty ();

  while (x)
    {
      bar ();
      ++x;
    }

  while (y)
    acc += y;

  *p = choose (acc, 1);
  quux ();

  return x;
}