| 1 |
/* Test that imaginary constants are diagnosed in C23 mode: -pedantic. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic" } */ |
| 4 |
|
| 5 |
_Complex float a = 1.if; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 6 |
_Complex float b = 2.Fj; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 7 |
_Complex float c = 3.fI; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 8 |
_Complex float d = 4.JF; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 9 |
_Complex double e = 1.i; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 10 |
_Complex double f = 2.j; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 11 |
_Complex double g = 3.I; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 12 |
_Complex double h = 4.J; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 13 |
_Complex long double i = 1.il; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 14 |
_Complex long double j = 2.Lj; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 15 |
_Complex long double k = 3.lI; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 16 |
_Complex long double l = 4.JL; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */ |
| 17 |
__extension__ _Complex float m = 1.if; |
| 18 |
__extension__ _Complex float n = 2.Fj; |
| 19 |
__extension__ _Complex float o = 3.fI; |
| 20 |
__extension__ _Complex float p = 4.JF; |
| 21 |
__extension__ _Complex double q = 1.i; |
| 22 |
__extension__ _Complex double r = 2.j; |
| 23 |
__extension__ _Complex double s = 3.I; |
| 24 |
__extension__ _Complex double t = 4.J; |
| 25 |
__extension__ _Complex long double u = 1.il; |
| 26 |
__extension__ _Complex long double v = 2.Lj; |
| 27 |
__extension__ _Complex long double w = 3.lI; |
| 28 |
__extension__ _Complex long double x = 4.JL; |
| 29 |
|
| 30 |
int |
| 31 |
main () |
| 32 |
{ |
| 33 |
if (a * a != -1.f |
| 34 |
|| b * b != -4.f |
| 35 |
|| c * c != -9.f |
| 36 |
|| d * d != -16.f |
| 37 |
|| e * e != -1. |
| 38 |
|| f * f != -4. |
| 39 |
|| g * g != -9. |
| 40 |
|| h * h != -16. |
| 41 |
|| i * i != -1.L |
| 42 |
|| j * j != -4.L |
| 43 |
|| k * k != -9.L |
| 44 |
|| l * l != -16.L |
| 45 |
|| m * m != -1.f |
| 46 |
|| n * n != -4.f |
| 47 |
|| o * o != -9.f |
| 48 |
|| p * p != -16.f |
| 49 |
|| q * q != -1. |
| 50 |
|| r * r != -4. |
| 51 |
|| s * s != -9. |
| 52 |
|| t * t != -16. |
| 53 |
|| u * u != -1.L |
| 54 |
|| v * v != -4.L |
| 55 |
|| w * w != -9.L |
| 56 |
|| x * x != -16.L) |
| 57 |
__builtin_abort (); |
| 58 |
} |