Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr98219-1.c
blob89b5aa3b9cbaf1dd15432237647c6abc9f6e890f
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" } */
5 #include <x86gprintrin.h>
7 extern void exit (int);
8 typedef unsigned int uword_t __attribute__ ((mode (__word__)));
10 #define UIRRV 0x12345670
11 #define RIP 0x12345671
12 #define RFLAGS 0x12345672
13 #define RSP 0x12345673
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
20 void
21 __attribute__((interrupt, used))
22 fn (struct __uintr_frame *frame, uword_t uirrv)
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 ();
33 exit (0);
36 int
37 main ()
39 asm ("push $" STRING (RSP) "; \
40 push $" STRING (RFLAGS) "; \
41 push $" STRING (RIP) "; \
42 push $" STRING (UIRRV) "; \
43 jmp " ASMNAME ("fn"));
44 return 0;