view gcc/testsuite/gcc.dg/vec-andxor1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { 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;
}