| 1 |
/* PR tree-optimization/113372 */ |
| 2 |
/* { dg-do run { target bitint } } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 |
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O1" "-O2" } } */ |
| 5 |
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| 6 |
|
| 7 |
_BitInt(8) a, b, c; |
| 8 |
|
| 9 |
#if __BITINT_MAXWIDTH__ >= 6384 |
| 10 |
_BitInt(8) |
| 11 |
foo (_BitInt(6384) y) |
| 12 |
{ |
| 13 |
_BitInt(4745) x = -(b % y) * b; |
| 14 |
int i = __builtin_sub_overflow_p (-y, 0, 0); |
| 15 |
c |= __builtin_add_overflow_p (i, 0, a); |
| 16 |
return x; |
| 17 |
} |
| 18 |
#endif |
| 19 |
|
| 20 |
int |
| 21 |
main () |
| 22 |
{ |
| 23 |
#if __BITINT_MAXWIDTH__ >= 6384 |
| 24 |
if (foo (4) != 0 || c != 0) |
| 25 |
__builtin_abort (); |
| 26 |
#endif |
| 27 |
return 0; |
| 28 |
} |