aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp97.c
blob: 582024d35e84a9cbf357e24b7ba9b6b5cc9ad3d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR tree-optimization/64454 */
/* { dg-options "-O2 -fdump-tree-vrp1" } */

int f(int a, int b)
{
    if (a < -3 || a > 13) __builtin_unreachable();
    if (b < -6 || b > 9) __builtin_unreachable();
    int c = a % b;
    return c >= -3 && c <= 8;
}

int g(int a, int b)
{
  int c = a % b;
  return c != -__INT_MAX__ - 1;
}

/* { dg-final { scan-tree-dump-times "return 1;" 2 "vrp1" } } */