| 1 |
/* PR c/102989 */ |
| 2 |
/* { dg-do run { target bitint } } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 |
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */ |
| 5 |
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| 6 |
|
| 7 |
#if __BITINT_MAXWIDTH__ >= 256 |
| 8 |
__attribute__((noipa)) _Bool |
| 9 |
test256 (_BitInt(256) *q) |
| 10 |
{ |
| 11 |
return __builtin_sub_overflow ((_BitInt(256)) 0, q[0], q + 1); |
| 12 |
} |
| 13 |
#endif |
| 14 |
|
| 15 |
int |
| 16 |
main () |
| 17 |
{ |
| 18 |
#if __BITINT_MAXWIDTH__ >= 256 |
| 19 |
static _BitInt(256) q256[] = { |
| 20 |
45345032714412617256156490782169070529322290545773058110333871537162440472587wb, |
| 21 |
0wb, |
| 22 |
-45345032714412617256156490782169070529322290545773058110333871537162440472587wb, |
| 23 |
-45345032714412617256156490782169070529322290545773058110333871537162440472587wb, |
| 24 |
0wb, |
| 25 |
45345032714412617256156490782169070529322290545773058110333871537162440472587wb, |
| 26 |
-57896044618658097711785492504343953926634992332820282019728792003956564819967wb - 1, |
| 27 |
0wb, |
| 28 |
-57896044618658097711785492504343953926634992332820282019728792003956564819967wb - 1 |
| 29 |
}; |
| 30 |
for (int i = 0; i < 3; ++i) |
| 31 |
if (test256 (q256 + 3 * i) != (i == 2) || q256[3 * i + 1] != q256[3 * i + 2]) |
| 32 |
__builtin_abort (); |
| 33 |
#endif |
| 34 |
} |