1  /* { dg-do compile } */
       2  /* { dg-options "-mshared -mexplicit-relocs -fno-delayed-branch -fno-unroll-loops" } */
       3  /* We can load into something other than $25 when not optimizing,
       4     then immediately move into $25.  */
       5  /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
       6  
       7  void bar (void);
       8  
       9  NOMIPS16 void
      10  foo (int n)
      11  {
      12    while (n--)
      13      {
      14        bar ();
      15        bar ();
      16      }
      17  }
      18  
      19  /* There should be exactly five uses of $25: one to set up $gp, two to
      20     load the address of bar (), and two to call it.  */
      21  /* { dg-final { scan-assembler-times "\tl.\t\\\$25,%call16\\\(bar\\\)" 2 } } */
      22  /* { dg-final { scan-assembler-times "\tjalrc?s?\t\\\$25" 2 } } */
      23  /* { dg-final { scan-assembler "(\\\$28,|\t.cpload\t)\\\$25" } } */
      24  /* { dg-final { scan-assembler-times "\\\$25" 5 } } */