summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/altivec-34.c
blob: 8e6372bfb43dea93a50592c433aa6a6d11766256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* PR target/49621 */
/* { dg-do compile } */
/* { dg-options "-O2 -maltivec" } */

#include <altivec.h>

int
foo (void)
{
  vector unsigned a, b, c;
  unsigned k = 1;

  a = (vector unsigned) { 0, 0, 0, 1 };
  b = c = (vector unsigned) { 0, 0, 0, 0 };

  a = vec_add (a, vec_splats (k));
  b = vec_add (b, a);
  c = vec_sel (c, a, b);

  if (vec_any_eq (b, c))
    return 1;

  return 0;
}