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

     1  /* PR target/20583
     2     On m68k-none-elf, CSE used to generate
     3  
     4       (set (reg:HI ...)
     5            (const:HI (truncate:HI (minus:SI (label_ref ...)
     6                                             (label_ref ...)))))
     7  
     8     which output functions do not know how to handle.  Make sure that
     9     such a constant will be rejected.  */
    10  
    11  void bar (unsigned int);
    12  
    13  void
    14  foo (void)
    15  {
    16    char buf[1] = { 3 };
    17    const char *p = buf;
    18    const char **q = &p;
    19    unsigned int ch;
    20    switch (**q)
    21      {
    22      case 1:  ch = 5; break;
    23      case 2:  ch = 4; break;
    24      case 3:  ch = 3; break;
    25      case 4:  ch = 2; break;
    26      case 5:  ch = 1; break;
    27      default: ch = 0; break;
    28      }
    29    bar (ch);
    30  }