1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } */
2 /* { dg-options "-g -muintr -mgeneral-regs-only" } */
4 #include <x86gprintrin.h>
6 extern void exit (int);
7 typedef unsigned int uword_t
__attribute__ ((mode (__word__
)));
8 typedef int aligned
__attribute__((aligned(64)));
10 #define UIRRV 0x12345670
11 #define RIP 0x12345671
12 #define RFLAGS 0x12345672
13 #define RSP 0x12345673
15 #define STRING(x) XSTRING(x)
17 #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
18 #define ASMNAME2(prefix, cname) XSTRING (prefix) cname
21 check_int (int *i
, int align
)
24 if ((((ptrdiff_t) i
) & (align
- 1)) != 0)
30 __attribute__((interrupt
, used
))
31 fn (struct __uintr_frame
*frame
, uword_t uirrv
)
34 if (check_int (&i
, __alignof__(i
)) != i
)
37 if (UIRRV
!= uirrv
) /* BREAK */
39 if (RIP
!= frame
->rip
)
41 if (RFLAGS
!= frame
->rflags
)
43 if (RSP
!= frame
->rsp
)
52 asm ("push $" STRING (RSP
) "; \
53 push $" STRING (RFLAGS
) "; \
54 push $" STRING (RIP
) "; \
55 push $" STRING (UIRRV
) "; \
56 jmp " ASMNAME ("fn"));
60 /* { dg-final { gdb-test 34 "uirrv" "0x12345670" } } */
61 /* { dg-final { gdb-test 34 "frame->rip" "0x12345671" } } */
62 /* { dg-final { gdb-test 34 "frame->rflags" "0x12345672" } } */
63 /* { dg-final { gdb-test 34 "frame->rsp" "0x12345673" } } */