Debian Codegraph @

gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c

raw
1 /* PR middle-end/37009 */
2 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
3 /* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
4
5 #include "check.h"
6
7 void
8 bar (char *p, int size)
9 {
10 __builtin_strncpy (p, "good", size);
11 }
12
13 void
14 __attribute__ ((noinline))
15 foo (double x, double y ,double z ,double a, int size)
16 {
17 char *p = __builtin_alloca (size + 1);
18 double i;
19
20 bar (p, size);
21 if (__builtin_strncmp (p, "good", size) != 0)
22 {
23 #ifdef DEBUG
24 p[size] = '\0';
25 printf ("Failed: %s != good\n", p);
26 #endif
27 abort ();
28 }
29
30 check (&i, __alignof__(i));
31 }
32
33 int
34 main (void)
35 {
36 double x = 1.0 ;
37
38 foo (x, x, x, x, 5);
39
40 return 0;
41 }