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

     1  const char *__attribute__((noinline))
     2  foo (const char *p)
     3  {
     4    const char *end;
     5    int len = 1;
     6    for (;;)
     7      {
     8        int c = *p;
     9        c = (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
    10        if (c == 'B')
    11  	end = p;
    12        else if (c == 'A')
    13  	{
    14  	  end = p;
    15  	  do
    16  	    p++;
    17  	  while (*p == '+');
    18  	}
    19        else
    20  	break;
    21        p++;
    22        len++;
    23      }
    24    if (len > 2 && *p == ':')
    25      p = end;
    26    return p;
    27  }
    28  
    29  int
    30  main (void)
    31  {
    32    const char *input = "Bbb:";
    33    return foo (input) != input + 2;
    34  }