(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
nios2/
bmx.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -march=r2 -mbmx" } */
       3  
       4  /* Test generation of Nios II R2 BMX instructions.  */
       5  
       6  struct s {
       7    unsigned int pad1 : 3;
       8    unsigned int bitfield : 20;
       9    unsigned int intfield;
      10  };
      11  
      12  void f (struct s *a, struct s *b)
      13  {
      14    a->bitfield = b->bitfield;
      15  }
      16  
      17  void g (struct s *a, struct s *b)
      18  {
      19    a->bitfield = b->intfield;
      20  }
      21  
      22  void h (struct s *a, struct s *b)
      23  {
      24    a->intfield = b->bitfield;
      25  }
      26  
      27  /* { dg-final { scan-assembler "\tmerge\t.*, 22, 3" } }  */
      28  /* { dg-final { scan-assembler "\tinsert\t.*, 22, 3" } }  */
      29  /* { dg-final { scan-assembler "\textract\t.*, 22, 3" } }  */