(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arc/
uncached-5.c
       1  /* { dg-options "-O1" } */
       2  /* { dg-do compile } */
       3  
       4  #define RegWrSI(a,v)  (*(volatile __attribute__((uncached)) int *)(a)=(v))
       5  #define RegWrQI(a,v)  (*(volatile __attribute__((uncached)) char *)(a)=(v))
       6  #define RegWrHI(a,v)  (*(volatile __attribute__((uncached)) short *)(a)=(v))
       7  #define RegWrDI(a,v)  (*(volatile __attribute__((uncached)) long long *)(a)=(v))
       8  
       9  void foo (int arg, void *p)
      10  {
      11    RegWrDI (p  , arg);
      12    RegWrHI (p++, arg);
      13    RegWrSI (p++, arg);
      14    RegWrQI (p++, arg);
      15  }
      16  
      17  void bar (void)
      18  {
      19    RegWrQI (0x40000, 1);
      20    RegWrHI (0x40010, 2);
      21    RegWrSI (0x40020, 4);
      22    RegWrDI (0x40040, 8);
      23  }
      24  
      25  /* { dg-final { scan-assembler-times "stb\.di" 2 } } */
      26  /* { dg-final { scan-assembler-times "st\[hw\]\.di" 2 } } */
      27  /* { dg-final { scan-assembler-times "std\.di" 2 { target { ll64 } } } } */
      28  /* { dg-final { scan-assembler-times "st\.di" 2 { target { ll64 } } } } */
      29  /* { dg-final { scan-assembler-times "st\.di" 6 { target { ! { ll64 } } } } } */