(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nios2/
cdx-ldstwm-1.c
       1  /* { dg-do assemble } */
       2  /* { dg-options "-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -march=r2 -mcdx -w" } */
       3  
       4  /* Based on gcc.c-torture/compile/920501-23.c.
       5     This test used to result in assembler errors with R2 CDX because of
       6     a bug in regrename; it wasn't re-validating insns after renaming, so
       7     ldwm/stwm instructions with incorrect registers were being emitted.  */
       8  
       9  typedef unsigned char qi;
      10  typedef unsigned short hi;
      11  typedef unsigned long si;
      12  typedef unsigned long long di;
      13  subi(a){return 100-a;}
      14  add(a,b){return a+b;}
      15  mul(a){return 85*a;}
      16  memshift(p)unsigned*p;{unsigned x;for(;;){x=*p++>>16;if(x)return x;}}
      17  ldw(xp)si*xp;{return xp[4];}
      18  ldws_m(xp)si*xp;{si x;do{x=xp[3];xp+=3;}while(x);}
      19  postinc_si(p)si*p;{si x;for(;;){x=*p++;if(x)return x;}}
      20  preinc_si(p)si*p;{si x;for(;;){x=*++p;if(x)return x;}}
      21  postinc_di(p)di*p;{di x;for(;;){x=*p++;if(x)return x;}}
      22  preinc_di(p)di*p;{di x;for(;;){x=*++p;if(x)return x;}}
      23  inc_overlap(p,a)di*p;{do{p=*(di**)p;p=(di*)((int)p+4);}while(*p);}
      24  di move_di(p,p2)di*p,*p2;{di x=p;p2=((di*)x)[1];return p2[1];}