aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/vrp8.c
blob: a01ffbcc757997a4779d3e552f3e5f6e0182dc99 (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
42
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-cp-details" } */

volatile int cond;
int abs (int);

volatile int g;

int __attribute__((noinline, noclone))
take_address (int *p)
{
  g = *p;
}

static int __attribute__((noinline, noclone))
foo (int i)
{
  if (i < 5)
    __builtin_abort ();
  return 0;
}

static int __attribute__((noinline, noclone))
bar (int j)
{
  foo (~j);
  foo (abs (j));
  foo (j);
  take_address (&j);
  return 0;
}

int
main ()
{
  for (unsigned int i = 0; i < 10; ++i)
    bar (i);

  return 0;
}

/* { dg-final { scan-ipa-dump-times "Setting value range of param 0 \\(now 0\\) .irange. int \\\[-10, 9\\\]" 1 "cp" } } */