Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / vararg-2.c
blob804801256f19b10d5e2a4614162a5cb08cb30e8f
1 /* PR middle-end/36859 */
2 /* { dg-do run } */
3 /* { dg-options "-w" { target { lp64 } } } */
4 /* { dg-options "-w" { target { llp64 } } } */
5 /* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" { target { ilp32 } } } */
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 ();