Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / torture / stackalign / inline-2.c
blob85a2ee3f3ccaf35c6fe2e07d59ca777f8783e7c6
1 /* { dg-do run } */
2 /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
4 #include "check.h"
6 #ifndef ALIGNMENT
7 #define ALIGNMENT 64
8 #endif
10 typedef int aligned __attribute__((aligned(ALIGNMENT)));
12 int global;
14 void
15 bar (char *p, int size)
17 __builtin_strncpy (p, "good", size);
20 static void
21 inline __attribute__((always_inline))
22 foo (int size)
24 char *p = __builtin_alloca (size + 1);
25 aligned i;
27 bar (p, size);
28 if (__builtin_strncmp (p, "good", size) != 0)
30 #ifdef DEBUG
31 p[size] = '\0';
32 printf ("Failed: %s != good\n", p);
33 #endif
34 abort ();
37 if (check_int (&i, __alignof__(i)) != i)
38 abort ();
41 int
42 main()
44 foo (5);
45 return 0;