summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/pr95113.c
blob: a8f8c901ebeec1329a267a5165f73f5cf7c01bd8 (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
/* { dg-do run } */
/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
/* { dg-require-effective-target exceptions } */

int a, b;

static inline long int
foo (long int x, int y)
{
  if (y == 0)
    return 0;

  if (x == -1 && y == -1)
    return 0;

  return x / y;
}

static inline int
bar (int *p)
{
  int c = foo (a, 1) + *p;
  return b;
}

int
main ()
{
  int d = 0;
  b = foo (1, 1);
  bar (&d);
  return 0;
}