(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
c2x-digit-separators-1.c
       1  /* Test C2x digit separators.  Valid usages.  */
       2  /* { dg-do run } */
       3  /* { dg-options "-std=c2x -pedantic-errors" } */
       4  
       5  _Static_assert (123'45'6 == 123456);
       6  _Static_assert (0'123 == 0123);
       7  _Static_assert (0x1'23 == 0x123);
       8  
       9  #define m(x) 0
      10  
      11  _Static_assert (m(1'2)+(3'4) == 34);
      12  
      13  _Static_assert (0x0'e-0xe == 0);
      14  
      15  #define a0 '.' -
      16  #define acat(x) a ## x
      17  _Static_assert (acat (0'.') == 0);
      18  
      19  #define c0(x) 0
      20  #define b0 c0 (
      21  #define bcat(x) b ## x
      22  _Static_assert (bcat (0'\u00c0')) == 0);
      23  
      24  extern void exit (int);
      25  extern void abort (void);
      26  
      27  int
      28  main (void)
      29  {
      30    if (314'159e-0'5f != 3.14159f)
      31      abort ();
      32    exit (0);
      33  }
      34  
      35  #line 0'123
      36  _Static_assert (__LINE__ == 123);
      37  
      38  #line 4'56'7'8'9
      39  _Static_assert (__LINE__ == 456789);