modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c (about)

     1  /* { dg-options "-finput-charset=utf-8" } */
     2  typedef __WCHAR_TYPE__ wchar_t;
     3  wchar_t x[] = L"Ä";
     4  wchar_t y = L'Ä';
     5  extern void abort (void);
     6  extern void exit (int);
     7  
     8  int main (void)
     9  {
    10    if (sizeof (x) / sizeof (wchar_t) != 2)
    11      abort ();
    12    if (x[0] != L'Ä' || x[1] != L'\0')
    13      abort ();
    14    if (y != L'Ä')
    15      abort ();
    16    exit (0);
    17  }