1 /* { dg-options "-mno-micromips -mrelax-pic-calls -mshared -foptimize-sibling-calls -mabi=32" } */
2 /* { dg-skip-if "requires -foptimize-sibling-calls" { *-*-* } { "-O0" } { "" } } */
3 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal\n1:\tjalrc?\t" } } */
4 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,normal2\n1:\tjalrc?\t" } } */
5 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,staticfunc\n1:\tjalrc?\t" } } */
6 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,tail\n1:\tjrc?\t" } } */
7 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,tail2\n1:\tjrc?\t" } } */
8 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,tail3\n1:\tjrc?\t" } } */
9 /* { dg-final { scan-assembler "\\.reloc\t1f,R_MIPS_JALR,tail4\n1:\tjrc?\t" } } */
10
staticfunc()11 __attribute__ ((noinline)) static void staticfunc () { asm (""); }
12 int normal ();
13 void normal2 ();
14
15 int
f(int * p)16 NOMIPS16 f (int *p)
17 {
18 *p = normal ();
19 normal2 ();
20 staticfunc ();
21 return 1;
22 }
23
24 int tail ();
25
26 int
h()27 NOMIPS16 h ()
28 {
29 return tail ();
30 }
31
32 void tail2 ();
33
g()34 NOMIPS16 void g ()
35 {
36 tail2 ();
37 }
38
39 __attribute__ ((visibility ("hidden"))) void tail3 ();
40
j()41 NOMIPS16 void j ()
42 {
43 tail3 ();
44 }
45
tail4()46 __attribute__ ((noinline)) static void tail4 () { asm (""); }
47
k()48 NOMIPS16 void k ()
49 {
50 tail4 ();
51 }
52