| 1 |
/* PR c/102989 */ |
| 2 |
/* { dg-do compile { target bitint } } */ |
| 3 |
/* { dg-options "-std=gnu23" } */ |
| 4 |
|
| 5 |
#define expr_has_type(e, t) _Generic (e, default : 0, t : 1) |
| 6 |
|
| 7 |
void |
| 8 |
foo (_Complex int ci, _Complex long long cl) |
| 9 |
{ |
| 10 |
_BitInt(__SIZEOF_INT__ * __CHAR_BIT__ - 1) bi = 0wb; |
| 11 |
_BitInt(__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1) bl = 0wb; |
| 12 |
static_assert (expr_has_type (ci + bi, _Complex int)); |
| 13 |
static_assert (expr_has_type (cl + bl, _Complex long long)); |
| 14 |
static_assert (expr_has_type (bi + ci, _Complex int)); |
| 15 |
static_assert (expr_has_type (bl + cl, _Complex long long)); |
| 16 |
} |