Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / stackalign / alloca-2.c
blob2ef17629d7b13fdce21d7c26c8b67da8c2104bb2
1 /* PR middle-end/37009 */
2 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
3 /* { dg-additional-options "-mmmx -msse2" } */
4 /* { dg-require-effective-target sse2_runtime } */
6 #include <emmintrin.h>
7 #include "check.h"
9 #ifndef ALIGNMENT
10 #define ALIGNMENT 16
11 #endif
13 typedef int aligned __attribute__((aligned(ALIGNMENT)));
15 void
16 bar (char *p, int size)
18 __builtin_strncpy (p, "good", size);
21 void
22 __attribute__ ((noinline))
23 foo (__m128 x, __m128 y ,__m128 z , 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 (void)
45 __m128 x = { 1.0 };
46 foo (x, x, x, 5);
48 return 0;