libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-digit-separators-1.c
blob4b5f4f6951d85bc27d7763a38172a991af375a61
1 /* Test C23 digit separators. Valid usages. */
2 /* { dg-do run } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
5 _Static_assert (123'45'6 == 123456);
6 _Static_assert (0'123 == 0123);
7 _Static_assert (0x1'23 == 0x123);
9 #define m(x) 0
11 _Static_assert (m(1'2)+(3'4) == 34);
13 _Static_assert (0x0'e-0xe == 0);
15 #define a0 '.' -
16 #define acat(x) a ## x
17 _Static_assert (acat (0'.') == 0);
19 #define c0(x) 0
20 #define b0 c0 (
21 #define bcat(x) b ## x
22 _Static_assert (bcat (0'\u00c0')) == 0);
24 extern void exit (int);
25 extern void abort (void);
27 int
28 main (void)
30 if (314'159e-0'5f != 3.14159f)
31 abort ();
32 exit (0);
35 #line 0'123
36 _Static_assert (__LINE__ == 123);
38 #line 4'56'7'8'9
39 _Static_assert (__LINE__ == 456789);