aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr98727.c
blob: 7ecdef805826552c1768114016e29e77e86d9e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR tree-optimization/98727 */

__attribute__((noipa)) long int
foo (long int x, long int y)
{
  long int z = (unsigned long) x * y;
  if (x != z / y)
    return -1;
  return z;
}

int
main ()
{
  if (foo (4, 24) != 96
      || foo (124, 126) != 124L * 126
      || foo (__LONG_MAX__ / 16, 17) != -1)
    __builtin_abort ();
  return 0;
}