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

     1  /* PR tree-optimization/86714 - tree-ssa-forwprop.c confused by too
     2     long initializer
     3  
     4     The excessively long initializer for a[0] is undefined but this
     5     test verifies that the excess elements are not considered a part
     6     of the value of the array as a matter of QoI.  */
     7  
     8  const char a[2][3] = { "1234", "xyz" };
     9  char b[6];
    10  
    11  void *pb = b;
    12  
    13  int main ()
    14  {
    15     __builtin_memcpy (b, a, 4);
    16     __builtin_memset (b + 4, 'a', 2);
    17  
    18     if (b[0] != '1' || b[1] != '2' || b[2] != '3'
    19         || b[3] != 'x' || b[4] != 'a' || b[5] != 'a')
    20       __builtin_abort ();
    21  
    22     if (__builtin_memcmp (pb, "123xaa", 6))
    23       __builtin_abort ();
    24  
    25     return 0;
    26  }