aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/divmod-7.c
blob: faa90b3ac8f211a4da2486594d7ccc13f8f5a19c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-require-effective-target divmod_simode } */
/* { dg-options "-O2 -fdump-tree-widening_mul-details" } */

int f(int x, int y)
{
  int q = 0, r1 = 0, r2 = 0;
  extern int cond;

  if (cond)
    q = x / y;
  else
    {
      r1 = x % y;
      return q + r1;
    }

  r2 = x % y;
  return q + r2;
}

/* { dg-final { scan-tree-dump-times "DIVMOD" 1 "widening_mul" } } */