1 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-g -mgeneral-regs-only" } */
6 extern void exit (int);
8 typedef unsigned int uword_t
__attribute__ ((mode (__word__
)));
9 typedef int aligned
__attribute__((aligned(64)));
13 #define FLAGS 0x12345673
17 #define STRING(x) XSTRING(x)
19 #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
20 #define ASMNAME2(prefix, cname) XSTRING (prefix) cname
22 struct interrupt_frame
32 check_int (int *i
, int align
)
35 if ((((ptrdiff_t) i
) & (align
- 1)) != 0)
40 __attribute__((interrupt
, used
))
42 fn (struct interrupt_frame
*frame
)
45 if (check_int (&i
, __alignof__(i
)) != i
)
48 if (IP
!= frame
->ip
) /* BREAK */
52 if (FLAGS
!= frame
->flags
)
65 asm ("push $" STRING (SS
) "; \
66 push $" STRING (SP
) "; \
67 push $" STRING (FLAGS
) "; \
68 push $" STRING (CS
) "; \
69 push $" STRING (IP
) "; \
70 jmp " ASMNAME ("fn"));
74 /* { dg-final { gdb-test 46 "frame->ip" "0x12345671" } } */
75 /* { dg-final { gdb-test 46 "frame->cs" "0x12345672" } } */
76 /* { dg-final { gdb-test 46 "frame->flags" "0x12345673" } } */
77 /* { dg-final { gdb-test 46 "frame->sp" "0x12345674" } } */
78 /* { dg-final { gdb-test 46 "frame->ss" "0x12345675" } } */