Debian Codegraph @

gcc/testsuite/gcc.dg/c23-imaginary-constants-5.c

raw
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 float128 } */
5 /* { dg-require-effective-target float128 } */
6
7 _Complex _Float128 a = 1.if128; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */
8 _Complex _Float128 b = 2.F128j; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */
9 _Complex _Float128 c = 3.f128i; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */
10 _Complex _Float128 d = 4.JF128; /* { dg-warning "imaginary constants are a C2Y feature or GCC extension" } */
11 __extension__ _Complex _Float128 e = 1.if128;
12 __extension__ _Complex _Float128 f = 2.F128j;
13 __extension__ _Complex _Float128 g = 3.f128i;
14 __extension__ _Complex _Float128 h = 4.JF128;
15
16 int
17 main ()
18 {
19 if (a * a != -1.f128
20 || b * b != -4.f128
21 || c * c != -9.f128
22 || d * d != -16.f128
23 || e * e != -1.f128
24 || f * f != -4.f128
25 || g * g != -9.f128
26 || h * h != -16.f128)
27 __builtin_abort ();
28 }