(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
sh/
pr52483-3.c
       1  /* Check that loads/stores from/to volatile mems utilize indexed addressing
       2     modes and do not result in redundant sign/zero extensions. */
       3  /* { dg-do compile }  */
       4  /* { dg-options "-O1" } */
       5  /* { dg-final { scan-assembler-times "@\\(r0," 6 } } */
       6  /* { dg-final { scan-assembler-not "exts|extu" } } */
       7  
       8  int
       9  test_00 (volatile char* x, unsigned int y)
      10  {
      11    return x[y];
      12  }
      13  
      14  void
      15  test_100 (volatile char* x, unsigned int y, char z)
      16  {
      17    x[y] = z;
      18  }
      19  
      20  int
      21  test_01 (volatile short* x, unsigned int y)
      22  {
      23    return x[y];
      24  }
      25  
      26  void
      27  test_101 (volatile short* x, unsigned int y, short z)
      28  {
      29    x[y] = z;
      30  }
      31  
      32  int
      33  test_02 (volatile int* x, unsigned int y)
      34  {
      35    return x[y];
      36  }
      37  
      38  int
      39  test_102 (volatile int* x, unsigned int y, int z)
      40  {
      41    x[y] = z;
      42  }