| 1 |
/* Test that imaginary constants are diagnosed in C23 mode: -pedantic-errors. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 |
/* { dg-add-options float32 } */ |
| 5 |
/* { dg-add-options float64 } */ |
| 6 |
/* { dg-add-options float32x } */ |
| 7 |
/* { dg-require-effective-target float32 } */ |
| 8 |
/* { dg-require-effective-target float32x } */ |
| 9 |
/* { dg-require-effective-target float64 } */ |
| 10 |
|
| 11 |
_Complex _Float32 a = 1.if32; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 12 |
_Complex _Float32 b = 2.F32j; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 13 |
_Complex _Float32 c = 3.f32i; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 14 |
_Complex _Float32 d = 4.JF32; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 15 |
_Complex _Float64 e = 1.if64; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 16 |
_Complex _Float64 f = 2.F64j; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 17 |
_Complex _Float64 g = 3.f64i; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 18 |
_Complex _Float64 h = 4.JF64; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 19 |
_Complex _Float32x i = 1.if32x; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 20 |
_Complex _Float32x j = 2.F32xj; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 21 |
_Complex _Float32x k = 3.f32xI; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 22 |
_Complex _Float32x l = 4.JF32x; /* { dg-error "imaginary constants are a C2Y feature or GCC extension" } */ |
| 23 |
__extension__ _Complex _Float32 m = 1.if32; |
| 24 |
__extension__ _Complex _Float32 n = 2.F32j; |
| 25 |
__extension__ _Complex _Float32 o = 3.f32i; |
| 26 |
__extension__ _Complex _Float32 p = 4.JF32; |
| 27 |
__extension__ _Complex _Float64 q = 1.if64; |
| 28 |
__extension__ _Complex _Float64 r = 2.F64j; |
| 29 |
__extension__ _Complex _Float64 s = 3.f64i; |
| 30 |
__extension__ _Complex _Float64 t = 4.JF64; |
| 31 |
__extension__ _Complex _Float32x u = 1.if32x; |
| 32 |
__extension__ _Complex _Float32x v = 2.F32xj; |
| 33 |
__extension__ _Complex _Float32x w = 3.f32xI; |
| 34 |
__extension__ _Complex _Float32x x = 4.JF32x; |