aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr69546-1.c
blob: 39db1792a0f6f1640956e4163c9f55acf0586357 (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
/* PR tree-optimization/69546 */
/* { dg-do run { target int128 } } */

unsigned __int128 __attribute__ ((noinline, noclone))
foo (unsigned long long x)
{
  unsigned __int128 y = ~0ULL;
  x >>= 63;
  return y / (x | 1);
}

unsigned __int128 __attribute__ ((noinline, noclone))
bar (unsigned long long x)
{
  unsigned __int128 y = ~33ULL;
  x >>= 63;
  return y / (x | 1);
}

int
main ()
{
  if (foo (1) != ~0ULL || bar (17) != ~33ULL)
    __builtin_abort ();
  return 0;
}