(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
sh/
pr54760-5.c
       1  /* Check that the GBR address optimization works when there are multiple
       2     GBR register definitions and function calls, if the GBR is marked as a
       3     call saved register.  */
       4  /* { dg-do compile }  */
       5  /* { dg-options "-O1 -fcall-saved-gbr" } */
       6  /* { dg-final { scan-assembler-not "stc\tgbr" } } */
       7  
       8  typedef struct
       9  {
      10    int x, y, z, w;
      11  } tcb_t;
      12  
      13  extern void test_00 (void);
      14  
      15  int
      16  test_01 (int x, volatile int* y, int a)
      17  {
      18    if (a)
      19      test_00 ();
      20  
      21    y[0] = 1;
      22  
      23    tcb_t* tcb = (tcb_t*)__builtin_thread_pointer ();
      24    return (a & 5) ? tcb->x : tcb->w;
      25  }