1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } */ 2 /* { dg-skip-if "PR81210 sp not aligned to 16 bytes" { *-*-darwin* } } */ 3 /* { dg-options "-muintr -mgeneral-regs-only" } */ 4 5 #include <x86gprintrin.h> 6 7 extern void exit (int); 8 typedef unsigned int uword_t __attribute__ ((mode (__word__))); 9 10 #define UIRRV 0x12345670 11 #define RIP 0x12345671 12 #define RFLAGS 0x12345672 13 #define RSP 0x12345673 14 15 #define STRING(x) XSTRING(x) 16 #define XSTRING(x) #x 17 #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) 18 #define ASMNAME2(prefix, cname) XSTRING (prefix) cname 19 20 void 21 __attribute__((interrupt, used)) fn(struct __uintr_frame * frame,uword_t uirrv)22fn (struct __uintr_frame *frame, uword_t uirrv) 23 { 24 if (UIRRV != uirrv) 25 __builtin_abort (); 26 if (RIP != frame->rip) 27 __builtin_abort (); 28 if (RFLAGS != frame->rflags) 29 __builtin_abort (); 30 if (RSP != frame->rsp) 31 __builtin_abort (); 32 33 exit (0); 34 } 35 36 int main()37main () 38 { 39 asm ("push $" STRING (RSP) "; \ 40 push $" STRING (RFLAGS) "; \ 41 push $" STRING (RIP) "; \ 42 push $" STRING (UIRRV) "; \ 43 jmp " ASMNAME ("fn")); 44 return 0; 45 } 46