| 1 |
/* PR tree-optimization/114425 */ |
| 2 |
/* { dg-do run { target bitint } } */ |
| 3 |
/* { dg-options "-std=c23" } */ |
| 4 |
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */ |
| 5 |
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| 6 |
|
| 7 |
#if __BITINT_MAXWIDTH__ >= 2000 |
| 8 |
_BitInt(8) a; |
| 9 |
_BitInt(300) b; |
| 10 |
_BitInt(2000) c; |
| 11 |
|
| 12 |
__attribute__((noipa)) unsigned |
| 13 |
foo (_BitInt(2000) d) |
| 14 |
{ |
| 15 |
int o = __builtin_add_overflow_p (d, 0, b); |
| 16 |
_BitInt(2000) m = c * a; |
| 17 |
unsigned u = m; |
| 18 |
return u + o; |
| 19 |
} |
| 20 |
#endif |
| 21 |
|
| 22 |
int |
| 23 |
main () |
| 24 |
{ |
| 25 |
#if __BITINT_MAXWIDTH__ >= 2000 |
| 26 |
if (foo (0xfa7ac16f2613255eeb217e871c1f02221e26ce11f82d6a33206ec0ad5d4414722019933c0e2wb) != 1) |
| 27 |
__builtin_abort (); |
| 28 |
#endif |
| 29 |
} |