* gcc.target/i386/pr70021.c: Add -mtune=skylake.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / 20060512-1.c
blobec163a9bc51e9ffd51a9052dc7856d891eb367bf
1 /* { dg-do run } */
2 /* { dg-options "-std=gnu99 -msse2 -mpreferred-stack-boundary=4" } */
3 /* { dg-require-effective-target sse2 } */
5 #include "sse2-check.h"
7 #include <emmintrin.h>
9 #ifdef __x86_64__
10 # define PUSH "pushq %rsi"
11 # define POP "popq %rsi"
12 #else
13 # define PUSH "pushl %esi"
14 # define POP "popl %esi"
15 #endif
17 __m128i __attribute__ ((__noinline__))
18 vector_using_function ()
20 volatile __m128i vx; /* We want to force a vector-aligned store into the stack. */
21 vx = _mm_xor_si128 (vx, vx);
22 return vx;
24 int __attribute__ ((__noinline__, __force_align_arg_pointer__))
25 self_aligning_function (int x, int y)
27 __m128i ignored = vector_using_function ();
28 return (x + y);
30 int g_1 = 20;
31 int g_2 = 22;
33 static void
34 sse2_test (void)
36 int result;
37 asm (PUSH); /* Misalign runtime stack. */
38 result = self_aligning_function (g_1, g_2);
39 if (result != 42)
40 abort ();
41 asm (POP);