| 1 |
/* PR tree-optimization/113774 */ |
| 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__ >= 512 |
| 8 |
unsigned _BitInt(512) u; |
| 9 |
unsigned _BitInt(512) v; |
| 10 |
|
| 11 |
void |
| 12 |
foo (unsigned _BitInt(255) a, unsigned _BitInt(257) b, unsigned _BitInt(512) *r) |
| 13 |
{ |
| 14 |
b += v; |
| 15 |
b |= a - b; |
| 16 |
unsigned _BitInt(512) c = b * 6; |
| 17 |
unsigned _BitInt(512) h = c >> u; |
| 18 |
*r = h; |
| 19 |
} |
| 20 |
#endif |
| 21 |
|
| 22 |
int |
| 23 |
main () |
| 24 |
{ |
| 25 |
#if __BITINT_MAXWIDTH__ >= 512 |
| 26 |
unsigned _BitInt(512) x; |
| 27 |
foo (0x10000000000000000wb, 0x10000000000000001wb, &x); |
| 28 |
if (x != 0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffawb) |
| 29 |
__builtin_abort (); |
| 30 |
#endif |
| 31 |
return 0; |
| 32 |
} |