PR rtl-optimization/88018
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / vector-compare-2.c
blob628a699034815820aa914390b173b56058f5b89a
1 /* { dg-do run } */
2 /* { dg-options "-Wno-psabi -w" } */
3 #define vector(elcount, type) \
4 __attribute__((vector_size((elcount)*sizeof(type)))) type
6 /* Check that constant folding in
7 these simple cases works. */
8 vector (4, int)
9 foo (vector (4, int) x)
11 return (x == x) + (x != x) + (x > x)
12 + (x < x) + (x >= x) + (x <= x);
15 int
16 main (int argc, char *argv[])
18 vector (4, int) t = {argc, 2, argc, 42};
19 vector (4, int) r;
20 int i;
22 r = foo (t);
24 for (i = 0; i < 4; i++)
25 if (r[i] != -3)
26 __builtin_abort ();
28 return 0;