1 /* PR middle-end/56420 */ 2 /* { dg-do run { target int128 } } */ 3 4 extern void abort (void); 5 6 __attribute__((noinline, noclone)) __uint128_t foo(__uint128_t x)7foo (__uint128_t x) 8 { 9 return x * (((__uint128_t) -1) << 63); 10 } 11 12 __attribute__((noinline, noclone)) __uint128_t bar(__uint128_t x)13bar (__uint128_t x) 14 { 15 return x * (((__uint128_t) 1) << 63); 16 } 17 18 __attribute__((noinline, noclone)) __uint128_t baz(__uint128_t x)19baz (__uint128_t x) 20 { 21 return x * -(((__uint128_t) 1) << 62); 22 } 23 24 int main()25main () 26 { 27 if (foo (1) != (((__uint128_t) -1) << 63) 28 || foo (8) != (((__uint128_t) -1) << 66)) 29 abort (); 30 if (bar (1) != (((__uint128_t) 1) << 63) 31 || bar (8) != (((__uint128_t) 1) << 66)) 32 abort (); 33 if (baz (1) != -(((__uint128_t) 1) << 62) 34 || baz (8) != ((-(((__uint128_t) 1) << 62)) << 3)) 35 abort (); 36 return 0; 37 } 38