OSDN Git Service

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