Fix file cache tunables documentation
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-digit-separators-1.c
blob03fe1f48cfc91a36349b89e277aec87464eb4235
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);
8 _Static_assert (0b1'01 == 0b101);
10 #define m(x) 0
12 _Static_assert (m(1'2)+(3'4) == 34);
14 _Static_assert (0x0'e-0xe == 0);
16 #define a0 '.' -
17 #define acat(x) a ## x
18 _Static_assert (acat (0'.') == 0);
20 #define c0(x) 0
21 #define b0 c0 (
22 #define bcat(x) b ## x
23 _Static_assert (bcat (0'\u00c0')) == 0);
25 extern void exit (int);
26 extern void abort (void);
28 int
29 main (void)
31 if (314'159e-0'5f != 3.14159f)
32 abort ();
33 exit (0);
36 #line 0'123
37 _Static_assert (__LINE__ == 123);
39 #line 4'56'7'8'9
40 _Static_assert (__LINE__ == 456789);