libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / stackalign / inline-2.c
blob37ee84f9efa0933da874ab2cbc9cbc2d360ce3f3
1 /* { dg-do run } */
2 /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
3 /* { dg-require-effective-target alloca } */
5 #include "check.h"
7 #ifndef ALIGNMENT
8 #define ALIGNMENT 64
9 #endif
11 typedef int aligned __attribute__((aligned(ALIGNMENT)));
13 int global;
15 void
16 bar (char *p, int size)
18 __builtin_strncpy (p, "good", size);
21 static void
22 inline __attribute__((always_inline))
23 foo (int size)
25 char *p = __builtin_alloca (size + 1);
26 aligned i;
28 bar (p, size);
29 if (__builtin_strncmp (p, "good", size) != 0)
31 #ifdef DEBUG
32 p[size] = '\0';
33 printf ("Failed: %s != good\n", p);
34 #endif
35 abort ();
38 if (check_int (&i, __alignof__(i)) != i)
39 abort ();
42 int
43 main()
45 foo (5);
46 return 0;