| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0" } */ |
| 3 |
/* Check that naked functions don't place arguments on the stack at |
| 4 |
optimisation level '-O0'. */ |
| 5 |
|
| 6 |
#if defined(__HS__) || defined(__EM__) |
| 7 |
# define ILINK "ilink" |
| 8 |
#else |
| 9 |
# define ILINK "ilink1" |
| 10 |
#endif |
| 11 |
|
| 12 |
extern void bar (int); |
| 13 |
|
| 14 |
void __attribute__((naked, interrupt(ILINK))) |
| 15 |
foo (int n, int m) |
| 16 |
{ |
| 17 |
bar (n + m); |
| 18 |
} |
| 19 |
/* { dg-final { scan-assembler "\tbl\\\s+@bar" } } */ |
| 20 |
|
| 21 |
/* Look for things that would appear in a non-naked function, but which |
| 22 |
should not appear in a naked function. */ |
| 23 |
/* { dg-final { scan-assembler-not "\trtie" } } */ |
| 24 |
/* { dg-final { scan-assembler-not "j.*\[ilink1\]" } } */ |
| 25 |
/* { dg-final { scan-assembler-not "\tst.*\\\s+" } } */ |
| 26 |
/* { dg-final { scan-assembler-not "\tmov\\\s+fp,sp" } } */ |