OSDN Git Service

gcc/testsuite/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / mips / lazy-binding-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-mabicalls -mshared -mexplicit-relocs -O2 -fno-delayed-branch" } */
3
4 void bar (void);
5
6 NOMIPS16 void
7 foo (int n)
8 {
9   while (n--)
10     {
11       bar ();
12       bar ();
13     }
14 }
15
16 /* There should be exactly five uses of $25: one to set up $gp, two to
17    load the address of bar (), and two to call it.  */
18 /* { dg-final { scan-assembler-times "\tl.\t\\\$25,%call16\\\(bar\\\)" 2 } } */
19 /* { dg-final { scan-assembler-times "\tjalr\t\\\$25" 2 } } */
20 /* { dg-final { scan-assembler "(\\\$28,|\t.cpload\t)\\\$25" } } */
21 /* { dg-final { scan-assembler-times "\\\$25" 5 } } */