summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-prof/pr79587.c
blob: 517e081991922dc4a1b606866af35281d1fa6cd8 (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
/* { dg-require-effective-target lto } */
/* { dg-options "-O2 -flto" } */

unsigned long global = -12345;

unsigned long
__attribute__((noinline))
test(unsigned long v, unsigned long v2)
{
  unsigned long x = v % v2;

  return x;
}

int main(int argc, char **argv)
{
  unsigned long r = 0;

  for (int i = 0; i < 100; i++)
    r += test(argc, global);

  if (r != 100)
    __builtin_abort ();

  return 0;
}