| 1 |
/* Test that imaginary constants are diagnosed in C23 mode: -pedantic. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic" } */ |
| 4 |
/* { dg-add-options float64x } */ |
| 5 |
/* { dg-require-effective-target float64x } */ |
| 6 |
|
| 7 |
_Complex _Float64x a = 1.if64x; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 8 |
_Complex _Float64x b = 2.F64xj; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 9 |
_Complex _Float64x c = 3.f64xi; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 10 |
_Complex _Float64x d = 4.JF64x; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 11 |
__extension__ _Complex _Float64x e = 1.if64x; |
| 12 |
__extension__ _Complex _Float64x f = 2.F64xj; |
| 13 |
__extension__ _Complex _Float64x g = 3.f64xi; |
| 14 |
__extension__ _Complex _Float64x h = 4.JF64x; |
| 15 |
|
| 16 |
int |
| 17 |
main () |
| 18 |
{ |
| 19 |
if (a * a != -1.f64x |
| 20 |
|| b * b != -4.f64x |
| 21 |
|| c * c != -9.f64x |
| 22 |
|| d * d != -16.f64x |
| 23 |
|| e * e != -1.f64x |
| 24 |
|| f * f != -4.f64x |
| 25 |
|| g * g != -9.f64x |
| 26 |
|| h * h != -16.f64x) |
| 27 |
__builtin_abort (); |
| 28 |
} |