| 1 |
/* { dg-do compile { target ia32 } } */ |
| 2 |
/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -miamcu -maccumulate-outgoing-args" } */ |
| 3 |
|
| 4 |
struct interrupt_frame; |
| 5 |
|
| 6 |
extern void callback0 (unsigned int id, unsigned int len) |
| 7 |
__attribute__((no_caller_saved_registers)); |
| 8 |
extern void callback1 (unsigned int id, unsigned int len) |
| 9 |
__attribute__((no_caller_saved_registers)); |
| 10 |
extern void callback2 (unsigned int id, unsigned int len) |
| 11 |
__attribute__((no_caller_saved_registers)); |
| 12 |
|
| 13 |
typedef void (*callback_t) (unsigned int id, unsigned int len) |
| 14 |
__attribute__((no_caller_saved_registers)); |
| 15 |
|
| 16 |
callback_t callback[] = |
| 17 |
{ |
| 18 |
callback0, |
| 19 |
callback1, |
| 20 |
callback2, |
| 21 |
}; |
| 22 |
|
| 23 |
unsigned int remaining; |
| 24 |
|
| 25 |
void |
| 26 |
__attribute__((no_caller_saved_registers)) |
| 27 |
handler(int uart) |
| 28 |
{ |
| 29 |
while (1) { |
| 30 |
if (remaining) { |
| 31 |
callback[uart](0, 0); |
| 32 |
break; |
| 33 |
} |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
int uart; |
| 38 |
|
| 39 |
void |
| 40 |
__attribute__((interrupt)) |
| 41 |
my_isr(struct interrupt_frame *frame) |
| 42 |
{ |
| 43 |
handler(uart); |
| 44 |
} |
| 45 |
|
| 46 |
/* { dg-final { scan-assembler-times "\tcld" 1 } } */ |