OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / 20060512-3.c
1 /* { dg-do run } */
2 /* { dg-require-effective-target ilp32 } */
3 /* { dg-options "-std=gnu99 -msse2 -mstackrealign" } */
4
5 #include "sse2-check.h"
6
7 #include <emmintrin.h>
8
9 __m128i __attribute__ ((__noinline__))
10 vector_using_function ()
11 {
12   volatile __m128i vx;  /* We want to force a vector-aligned store into the stack.  */
13   vx = _mm_xor_si128 (vx, vx);
14   return vx;
15 }
16 int __attribute__ ((__noinline__))
17 self_aligning_function (int x, int y)
18 {
19   __m128i ignored = vector_using_function ();
20   return (x + y);
21 }
22 int g_1 = 20;
23 int g_2 = 22;
24
25 static void
26 sse2_test (void)
27 {
28   int result;
29   asm ("pushl %esi");           /* Disalign runtime stack.  */
30   result = self_aligning_function (g_1, g_2);
31   asm ("popl %esi");
32   if (result != 42)
33     abort ();
34 }