aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/interrupt-5.c
blob: 5742b6f474334af9fbe61c532c19485f1ee9df17 (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
30
31
32
/* { dg-do link } */
/* { dg-options "-O -mgeneral-regs-only -mno-cld -g" } */

#include <stdint.h>

extern void link_error (void);

typedef unsigned int uword_t __attribute__ ((mode (__word__)));

struct interrupt_frame
{
  uword_t ip;
  uword_t cs;
  uword_t flags;
  uword_t sp;
  uword_t ss;
};

__attribute__ ((used, interrupt))
void
foo (struct interrupt_frame *frame, uword_t error)
{
  void *ra = __builtin_return_address (0);
  if ((uintptr_t) ra != (uintptr_t) frame->ip)
    link_error ();
}

int
main (void)
{
  return 0;
}