gcc/testsuite/gcc.dg/pr103431.c
raw| 1 | /* PR middle-end/103431 */ |
| 2 | /* { dg-do run { target int128 } } */ |
| 3 | /* { dg-options "-O -fno-tree-bit-ccp -fno-tree-dominator-opts" } */ |
| 4 | |
| 5 | __attribute__((noipa)) |
| 6 | void foo (unsigned short a) |
| 7 | { |
| 8 | __uint128_t b = 5; |
| 9 | int size = __SIZEOF_INT128__ * __CHAR_BIT__ - 1; |
| 10 | a /= 0xfffffffd; |
| 11 | __uint128_t c = (b << (a & size) | b >> (-(a & size) & size)); |
| 12 | if (c != 5) |
| 13 | __builtin_abort (); |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | main () |
| 18 | { |
| 19 | foo (0); |
| 20 | return 0; |
| 21 | } |