aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr93376.c
blob: 49341ff0a4b1918a7fd260a0002016b56f2bee84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR target/93376 */
/* { dg-do compile { target int128 } } */
/* { dg-options "-Og -finline-functions-called-once" } */

unsigned a, b, c;

int
bar (int x)
{
  short s = __builtin_sub_overflow (~x, 0, &b);
  a = __builtin_ffsll (~x);
  return __builtin_add_overflow_p (-(unsigned __int128) a, s,
				   (unsigned __int128) 0);
}

void
foo (void)
{
  c = bar (0);
}