OSDN Git Service

Support AVX for cmpss/cmpsd.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / sse-9.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse" } */
3
4 #include "sse-check.h"
5
6 #include <xmmintrin.h>
7 #include <stddef.h>
8 #include <string.h>
9
10 static void
11 sse_test (void)
12 {
13   int alignment, n;
14   void *ptr;
15   int errors = 0;
16   const char test [] = "This is a test.";
17
18   for (alignment = 1; alignment <= (1 << 20); alignment += alignment)
19     {
20       ptr = _mm_malloc (alignment, alignment);
21       if (((ptrdiff_t) ptr) & (alignment - 1))
22         abort ();
23       if (ptr)
24         {
25           n = alignment > sizeof test ? sizeof test : alignment;
26           memcpy (ptr, test, n);
27           if (memcmp (ptr, test, n) != 0)
28             errors++;
29           _mm_free (ptr);
30         }
31       else
32         errors++;
33     }
34    
35   if (errors != 0)
36     abort ();
37 }