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

     1  extern void *ff(void*,int);
     2  
     3  struct lpgl { struct lpgl *next; };
     4  struct lpgd { struct lpgl *first; };
     5  
     6  typedef int (*xfn)( );
     7  static void xDP_IF_EnumGroupsInGroup ( void *a, int b, xfn fn)
     8  {
     9    struct lpgd *lpGData;
    10    struct lpgl *lpGList;
    11  
    12    if( ( lpGData = ff( a, b ) ) == ((void *)0) )
    13      return;
    14  
    15    if( lpGData->first  == ((void *)0) )
    16      return;
    17    lpGList = lpGData->first;
    18  
    19    for( ;; ) {
    20      if( !(*fn)( ) )
    21        return;
    22      if( lpGList->next == ((void *)0) )
    23        break;
    24      lpGList = lpGList->next;
    25    }
    26    return;
    27  }
    28  
    29  
    30  static int 
    31  xcbDeletePlayerFromAllGroups() {
    32    xDP_IF_EnumGroupsInGroup(0, 0, 0);
    33    return 1;
    34  }
    35  
    36  void xDP_IF_EnumGroups( xfn fn) {
    37    xDP_IF_EnumGroupsInGroup( 0, 0, fn);
    38  }
    39  
    40  static void xDP_IF_DestroyPlayer () {
    41    xDP_IF_EnumGroups( xcbDeletePlayerFromAllGroups);
    42  }
    43  
    44  void* foo=xDP_IF_DestroyPlayer;