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

     1  /* This code was miscompiled at -O3 on x86.
     2     Reported by Jim Meyering; distilled from bash.  */
     3  
     4  int rl_show_char (int c) { return 0; }
     5  
     6  int rl_character_len (int c, int pos)
     7  {
     8    return isprint (c) ? 1 : 2;
     9  }
    10  
    11  int main(void)
    12  {
    13    int (*x)(int, int) = rl_character_len;
    14    if (x('a', 1) != 1)
    15      abort();
    16    if (x('\002', 1) != 2)
    17      abort();
    18    return 0;
    19  }