| 1 |
/* Verify that __attribute__((naked)) produces a naked function |
| 2 |
that does not use bx to return. Naked functions could be used |
| 3 |
to implement interrupt routines and must not return using bx. */ |
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-O0" } */ |
| 6 |
/* Use more arguments than we have argument registers. */ |
| 7 |
int __attribute__((naked)) foo(int a, int b, int c, int d, int e, int f) |
| 8 |
{ |
| 9 |
__asm__ volatile ("@ naked"); |
| 10 |
} |
| 11 |
/* { dg-final { scan-assembler "\t@ naked" } } */ |
| 12 |
/* { dg-final { scan-assembler-not "\tbx\tlr" } } */ |