| 1 |
/* PR tree-optimization/113361 */ |
| 2 |
/* { dg-do run { target { bitint && int128 } } } */ |
| 3 |
/* { dg-options "-std=gnu23" } */ |
| 4 |
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */ |
| 5 |
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| 6 |
|
| 7 |
#if __BITINT_MAXWIDTH__ >= 129 |
| 8 |
int |
| 9 |
foo (_BitInt(65) x) |
| 10 |
{ |
| 11 |
return __builtin_mul_overflow_p ((__int128) 0xffffffff << 64, x, (_BitInt(129)) 0); |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
bar (_BitInt(63) x) |
| 16 |
{ |
| 17 |
return __builtin_mul_overflow_p ((__int128) 0xffffffff << 64, x, (_BitInt(129)) 0); |
| 18 |
} |
| 19 |
#endif |
| 20 |
|
| 21 |
int |
| 22 |
main () |
| 23 |
{ |
| 24 |
#if __BITINT_MAXWIDTH__ >= 129 |
| 25 |
if (!foo (5167856845)) |
| 26 |
__builtin_abort (); |
| 27 |
if (!bar (5167856845)) |
| 28 |
__builtin_abort (); |
| 29 |
#endif |
| 30 |
return 0; |
| 31 |
} |