(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nios2/
const-addr-3.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-march=r2 -mno-cdx -mno-bmx -O2" } */
       3  /* { dg-final { scan-assembler-times "stwio\tr., 0\\(r" 2 } } */
       4  /* { dg-final { scan-assembler-times "stwio\tr., 528\\(r0\\)" 1 } } */
       5  
       6  /* These functions should not spill to stack.  */
       7  /* { dg-final { scan-assembler-not "addi\tsp, sp" } } */
       8  
       9  /* On R2, stwio takes only a 12-bit displacement so foo1 and foo2 need
      10     to use register indirect addressing.  */
      11  
      12  #define addr1 ((volatile int *) 0x43210)
      13  #define addr2 ((volatile int *) 0x3210)
      14  #define addr3 ((volatile int *) 0x210)
      15  
      16  #define SET(l,r) __builtin_stwio ((l), (r))
      17  
      18  void foo1 (int x) { SET (addr1, x); }
      19  void foo2 (int x) { SET (addr2, x); }
      20  void foo3 (int x) { SET (addr3, x); }