aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/vector-compare-3.c
blob: d6b0dac7cb9f29487c7f88366f9d750b448c41dd (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
25
/* { dg-do compile } */
/* { dg-options "-O2" } */

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

// fold should not turn (vec_other)(x<y) into (x<y)?vec_other(-1):vec_other(0).

void use (v4i const *z);

void
f (v4i *x, v4i *y)
{
  v4i const zz = *x < *y;
  use (&zz);
}

// Optimizations shouldn't introduce a boolean type in there

void
g (v4i *x, v4i const *y, v4i *z, v4i *t)
{
  *z = *x < *y | *x == *y;
  *t = *x < *y & *x > *y;
}