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

     1  static char *
     2  begfield (int tab, char *ptr, char *lim, int sword, int schar)
     3  {
     4    if (tab)
     5      {
     6        while (ptr < lim && sword--)
     7  	{
     8  	  while (ptr < lim && *ptr != tab)
     9  	    ++ptr;
    10  	  if (ptr < lim)
    11  	    ++ptr;
    12  	}
    13      }
    14    else
    15      {
    16        while (1)
    17  	;
    18      }
    19  
    20    if (ptr + schar <= lim)
    21      ptr += schar;
    22  
    23    return ptr;
    24  }
    25  
    26  main ()
    27  {
    28    char *s = ":ab";
    29    char *lim = s + 3;
    30    if (begfield (':', s, lim, 1, 1) != s + 2)
    31      abort ();
    32    exit (0);
    33  }