| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-Wno-psabi -w" } */ |
| 3 |
#define vector(elcount, type) \ |
| 4 |
__attribute__((vector_size((elcount)*sizeof(type)))) type |
| 5 |
|
| 6 |
/* Check that constant folding in |
| 7 |
these simple cases works. */ |
| 8 |
vector (4, int) |
| 9 |
foo (vector (4, int) x) |
| 10 |
{ |
| 11 |
return (x == x) + (x != x) + (x > x) |
| 12 |
+ (x < x) + (x >= x) + (x <= x); |
| 13 |
} |
| 14 |
|
| 15 |
int |
| 16 |
main (int argc, char *argv[]) |
| 17 |
{ |
| 18 |
vector (4, int) t = {argc, 2, argc, 42}; |
| 19 |
vector (4, int) r; |
| 20 |
int i; |
| 21 |
|
| 22 |
r = foo (t); |
| 23 |
|
| 24 |
for (i = 0; i < 4; i++) |
| 25 |
if (r[i] != -3) |
| 26 |
__builtin_abort (); |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |