(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
20101013-1.c
       1  /* PR rtl-optimization/45912 */
       2  
       3  extern void abort (void);
       4  
       5  static void* __attribute__((noinline,noclone))
       6  get_addr_base_and_unit_offset (void *base, long long *i)
       7  {
       8    *i = 0;
       9    return base;
      10  }
      11  
      12  static void* __attribute__((noinline,noclone))
      13  build_int_cst (void *base, long long offset)
      14  {
      15    if (offset != 4)
      16      abort ();
      17  
      18    return base;
      19  }
      20  
      21  static void* __attribute__((noinline,noclone))
      22  build_ref_for_offset (void *base, long long offset)
      23  {
      24    long long base_offset;
      25    base = get_addr_base_and_unit_offset (base, &base_offset);
      26    return build_int_cst (base, base_offset + offset / 8);
      27  }
      28  
      29  int
      30  main (void)
      31  {
      32    void *ret = build_ref_for_offset ((void *)0, 32);
      33    if (ret != (void *)0)
      34      abort ();
      35    return 0;
      36  }