aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vec-andxor1.c
blob: 4aa454e663bcdbdf803ce66c69e7a5bb845d9348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do run } */
/* { dg-options "-O" } */

typedef int vec __attribute__((vector_size(4*sizeof(int))));

__attribute__((noinline,noclone))
void f (vec *x) {
  *x = (*x & 1) ^ 1;
}

int main() {
  vec x = { 1, 2, 3, 4 };
  f(&x);
  if (x[0] != 0 || x[1] != 1)
    __builtin_abort();
  return 0;
}