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 void (*callback[1])(unsigned int id, unsigned int len);
7 unsigned int remaining;
8 
9 void
10 __attribute__((no_caller_saved_registers))
handler(int uart)11 handler(int uart)
12 {
13   while (1) {
14     if (remaining) {
15       callback[uart](0, 0);
16       break;
17     }
18   }
19 }
20 
21 int uart;
22 
23 void
24 __attribute__((interrupt))
my_isr(struct interrupt_frame * frame)25 my_isr(struct interrupt_frame *frame)
26 {
27   handler(uart);
28 }
29 
30 /* { dg-final { scan-assembler-times "\tcld" 1 } } */
31