PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / interrupt-23.c
blob95c211a54d580806450820a52ece5af8d76d986f
1 /* { dg-do compile { target ia32 } } */
2 /* { dg-options "-O2 -mgeneral-regs-only -mno-cld -miamcu -maccumulate-outgoing-args" } */
4 struct interrupt_frame;
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));
13 typedef void (*callback_t) (unsigned int id, unsigned int len)
14 __attribute__((no_caller_saved_registers));
16 callback_t callback[] =
18 callback0,
19 callback1,
20 callback2,
23 unsigned int remaining;
25 void
26 __attribute__((no_caller_saved_registers))
27 handler(int uart)
29 while (1) {
30 if (remaining) {
31 callback[uart](0, 0);
32 break;
37 int uart;
39 void
40 __attribute__((interrupt))
41 my_isr(struct interrupt_frame *frame)
43 handler(uart);
46 /* { dg-final { scan-assembler-times "\tcld" 1 } } */