| 1 |
/* { dg-do link } */ |
| 2 |
/* { dg-options "-O -mgeneral-regs-only -mno-cld -g" } */ |
| 3 |
|
| 4 |
#include <stdint.h> |
| 5 |
|
| 6 |
extern void link_error (void); |
| 7 |
|
| 8 |
typedef unsigned int uword_t __attribute__ ((mode (__word__))); |
| 9 |
|
| 10 |
struct interrupt_frame |
| 11 |
{ |
| 12 |
uword_t ip; |
| 13 |
uword_t cs; |
| 14 |
uword_t flags; |
| 15 |
uword_t sp; |
| 16 |
uword_t ss; |
| 17 |
}; |
| 18 |
|
| 19 |
__attribute__ ((used, interrupt)) |
| 20 |
void |
| 21 |
foo (struct interrupt_frame *frame, uword_t error) |
| 22 |
{ |
| 23 |
void *ra = __builtin_return_address (0); |
| 24 |
if ((uintptr_t) ra != (uintptr_t) frame->ip) |
| 25 |
link_error (); |
| 26 |
} |
| 27 |
|
| 28 |
int |
| 29 |
main (void) |
| 30 |
{ |
| 31 |
return 0; |
| 32 |
} |