i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bitfield-write-2.c
blob3b609183c5410672a2118d237d6b27dc7bf11c58
1 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-require-effective-target vect_long_long } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 extern void abort(void);
10 struct s {
11 unsigned i : 31;
12 char a : 4;
15 #define N 32
16 #define V 5
17 struct s A[N];
19 void __attribute__ ((noipa))
20 f(struct s *ptr, unsigned n) {
21 for (int i = 0; i < n; ++i)
22 ptr[i].a = V;
25 void __attribute__ ((noipa))
26 check_f(struct s *ptr) {
27 #pragma GCC novector
28 for (unsigned i = 0; i < N; ++i)
29 if (ptr[i].a != V)
30 abort ();
33 int main (void)
35 check_vect ();
36 __builtin_memset (&A[0], 0, sizeof(struct s) * N);
38 f(&A[0], N);
39 check_f (&A[0]);
41 return 0;
44 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
46 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */