(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
20021024-1.c
       1  /* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>.  */
       2  /* { dg-require-effective-target int32plus } */
       3  
       4  void exit (int);
       5  void abort (void);
       6  
       7  unsigned long long *cp, m;
       8  
       9  void foo (void)
      10  {
      11  }
      12  
      13  void bar (unsigned rop, unsigned long long *r)
      14  {
      15    unsigned rs1, rs2, rd;
      16  
      17  top:
      18    rs2 = (rop >> 23) & 0x1ff;
      19    rs1 = (rop >> 9) & 0x1ff;
      20    rd = rop & 0x1ff;
      21  
      22    *cp = 1;
      23    m = r[rs1] + r[rs2];
      24    *cp = 2;
      25    foo();
      26    if (!rd)
      27      goto top;
      28    r[rd] = 1;
      29  }
      30  
      31  int main(void)
      32  {
      33    static unsigned long long r[64];
      34    unsigned long long cr;
      35    cp = &cr;
      36  
      37    r[4] = 47;
      38    r[8] = 11;
      39    bar((8 << 23) | (4 << 9) | 15, r);
      40  
      41    if (m != 47 + 11)
      42      abort ();
      43    exit (0);
      44  }