OSDN Git Service

PR rtl-optimization/40924
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / torture / stackalign / unwind-2.C
1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
2
3 #include "test-unwind.h"
4
5 #if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
6 /* Test situation 2: stack really realign with DRAP reg CX */
7 void __attribute__ ((noinline))
8 foo ()
9 {
10   int __attribute__ ((aligned(64))) a=4;
11   char * s = (char *) __builtin_alloca (a + 1);
12
13   copy (s, a);
14   if (__builtin_strncmp (s, "good", a) != 0)
15     {
16 #ifdef DEBUG
17       s[a] = '\0';
18       printf ("Failed: %s != good\n", s);
19 #endif
20       abort ();
21     }
22
23   if (check_int (&a,  __alignof__(a)) != a)
24     abort ();
25
26   ALTER_REGS();
27   throw a;
28 }
29 #endif