libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bswap32.c
blob1139754bbf1b8f7ef7a5a86f5621c9fe319dec08
1 /* { dg-additional-options "-msse4" { target sse4_runtime } } */
3 #include "tree-vect.h"
5 #define N 128
7 static inline void
8 vfoo32 (unsigned int* a)
10 int i = 0;
11 for (i = 0; i < N; ++i)
12 a[i] = __builtin_bswap32 (a[i]);
15 int
16 main (void)
18 unsigned int arr[N];
19 unsigned int expect[N];
20 int i;
22 check_vect ();
24 for (i = 0; i < N; ++i)
26 arr[i] = i;
27 expect[i] = __builtin_bswap32 (i);
28 asm volatile ("" ::: "memory");
31 vfoo32 (arr);
33 #pragma GCC novector
34 for (i = 0; i < N; ++i)
36 if (arr[i] != expect[i])
37 abort ();
40 return 0;
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_bswap || sse4_runtime } } } } */