1 /* { dg-do compile } */
2 /* { dg-options "-O2 -march=r2 -mcdx" } */
3 
4 /* Check generation of R2 CDX callr.n, jmpr.n, ret.n instructions.  */
5 
6 typedef int (*F) (void);
7 
x(F f)8 int x (F f)
9 {
10   f ();
11 
12   /* Note that the compiler might generate a return via pop.n or ldwm;
13      the test below is to make sure that it doesn't generate a 32-bit
14      return instruction.  */
15   return 3;
16 }
17 
y(F f)18 int y (F f)
19 {
20   return f ();
21 }
22 
23 /* { dg-final { scan-assembler "\tcallr\\.n\t.*" } } */
24 /* { dg-final { scan-assembler-not "\tret$" } } */
25 /* { dg-final { scan-assembler "\tjmpr\\.n\t.*" } } */
26