| 1 |
/* PR tree-optimization/114433 */ |
| 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__ >= 511 |
| 8 |
struct S { int : 31; _BitInt(511) b : 300; } s; |
| 9 |
|
| 10 |
__attribute__((noipa)) _BitInt(511) |
| 11 |
foo (void) |
| 12 |
{ |
| 13 |
return s.b << 1; |
| 14 |
} |
| 15 |
#endif |
| 16 |
|
| 17 |
int |
| 18 |
main () |
| 19 |
{ |
| 20 |
#if __BITINT_MAXWIDTH__ >= 511 |
| 21 |
s.b = 642460398785925402356009598661384732715767737595497615767135001949421105426024498988100867wb; |
| 22 |
if (foo () != ((_BitInt(511)) 642460398785925402356009598661384732715767737595497615767135001949421105426024498988100867wb) << 1) |
| 23 |
__builtin_abort (); |
| 24 |
s.b = 2655156766298562299560755420298083843774074962786295887660222690220887wb; |
| 25 |
if (foo () != ((_BitInt(511)) 2655156766298562299560755420298083843774074962786295887660222690220887wb) << 1) |
| 26 |
__builtin_abort (); |
| 27 |
#endif |
| 28 |
} |