aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr103431.c
blob: 09f224a3903758f940eae5789937df754d2e15d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR middle-end/103431 */
/* { dg-do run { target int128 } } */
/* { dg-options "-O -fno-tree-bit-ccp -fno-tree-dominator-opts" } */

__attribute__((noipa))
void foo (unsigned short a)
{
  __uint128_t b = 5;
  int size = __SIZEOF_INT128__ * __CHAR_BIT__ - 1;
  a /= 0xfffffffd;
  __uint128_t c = (b << (a & size) | b >> (-(a & size) & size));
  if (c != 5)
    __builtin_abort ();
}

int
main ()
{
  foo (0);
  return 0;
}