PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bswap64.c
blobfd15d713c5d63db335e61c892c670b06ee9da25f
1 /* { dg-additional-options "-msse4" { target sse4_runtime } } */
3 #include "tree-vect.h"
5 #define N 128
7 static inline void
8 vfoo64 (unsigned long long* a)
10 int i = 0;
11 for (i = 0; i < N; ++i)
12 a[i] = __builtin_bswap64 (a[i]);
15 int
16 main (void)
18 unsigned long long arr[N];
19 unsigned long long expect[N];
20 int i;
22 check_vect ();
24 for (i = 0; i < N; ++i)
26 arr[i] = i;
27 expect[i] = __builtin_bswap64 (i);
28 asm volatile ("" ::: "memory");
31 vfoo64 (arr);
33 for (i = 0; i < N; ++i)
35 if (arr[i] != expect[i])
36 abort ();
39 return 0;
42 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_bswap || sse4_runtime } } } } */