re PR target/34981 (Lazily-bound function called twice)
[official-gcc.git] / gcc / testsuite / gcc.target / mips / lazy-binding-1.c
blobeb4f808f7787f31b98c694ede8939a2f122d50c2
1 /* { dg-mips-options "-mabicalls -mshared -mexplicit-relocs -O2 -fno-delayed-branch" } */
3 void bar (void);
5 void
6 foo (int n)
8 while (n--)
10 bar ();
11 bar ();
15 /* There should be exactly five uses of $25: one to set up $gp, two to
16 load the address of bar (), and two to call it. */
17 /* { dg-final { scan-assembler-times "\tl.\t\\\$25,%call16\\\(bar\\\)" 2 } } */
18 /* { dg-final { scan-assembler-times "\tjalr\t\\\$25" 2 } } */
19 /* { dg-final { scan-assembler "(\\\$28,|\t.cpload\t)\\\$25" } } */
20 /* { dg-final { scan-assembler-times "\\\$25" 5 } } */