summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/interrupt-22.c
blob: a51ba635414ca85ea258a24f9885373a9a190914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do compile { target ia32 } } */
/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -miamcu -maccumulate-outgoing-args" } */

struct interrupt_frame;

void (*callback) (unsigned int id, unsigned int len)
  __attribute__((no_caller_saved_registers));
unsigned int remaining;

void
__attribute__((no_caller_saved_registers))
handler(void)
{
  while (1) {
    if (remaining) {
      callback(0, 0);
      break;
    }
  }
}

void
__attribute__((interrupt))
my_isr(struct interrupt_frame *frame)
{
  handler();
}

/* { dg-final { scan-assembler-times "\tcld" 1 } } */