2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / vararg-2.c
blobbd5ad54463d25ca3d4da7361b2daccd1c5bc6e75
1 /* PR middle-end/36859 */
2 /* { dg-do run } */
3 /* { dg-options "-w" { target { ! { ia32 } } } } */
4 /* { dg-options "-w" { target { llp64 } } } */
5 /* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" { target { ia32 } } } */
6 /* { dg-require-effective-target sse2 } */
8 #include "sse2-check.h"
9 #include <stdarg.h>
10 #include <emmintrin.h>
12 __m128
13 __attribute__((noinline))
14 test (int a, ...)
16 __m128 x;
17 va_list va_arglist;
19 va_start (va_arglist, a);
20 x = va_arg (va_arglist, __m128);
21 va_end (va_arglist);
22 return x;
25 __m128 n1 = { -283.3, -23.3, 213.4, 1119.03 };
27 int
28 __attribute__((noinline))
29 foo (void)
31 __m128 x = test (1, n1);
32 if (__builtin_memcmp (&x, &n1, sizeof (x)) != 0)
33 abort ();
34 return 0;
37 static void
38 __attribute__((noinline))
39 sse2_test (void)
41 foo ();