1  /* { dg-do run } */
       2  /* { dg-options "-O2" } */
       3  
       4  
       5  #ifdef __XTENSA_CALL0_ABI__
       6  void __xtensa_libgcc_window_spill (void)
       7  {
       8  }
       9  #else
      10  void __xtensa_libgcc_window_spill (void);
      11  #endif
      12  
      13  __attribute__((noinline)) void h (void)
      14  {
      15    __xtensa_libgcc_window_spill ();
      16  }
      17  
      18  int f (int u, int v)
      19  {
      20    int a = u;
      21    int s;
      22  
      23    __attribute__((noinline,pure)) int nested1 (int b)
      24    {
      25        h();
      26        return a + b;
      27    }
      28  
      29    __attribute__((noinline,pure)) int nested2 (int b)
      30    {
      31        h();
      32        return a - b;
      33    }
      34  
      35    s = nested1 (v);
      36    s += nested2 (v);
      37    return s;
      38  }
      39  
      40  int main (void)
      41  {
      42    int u = 0x12345678;
      43    int v = 1;
      44  
      45    return f (u, v) == 2 * u ? 0 : 1;
      46  }