| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "--embed-directory ${srcdir}/c-c++-common/cpp/embed-dir" } */ |
| 3 |
/* { dg-additional-options "-std=gnu99" { target c } } */ |
| 4 |
|
| 5 |
const unsigned char magna_carta[] = { |
| 6 |
#embed <magna-carta.txt> limit (256) |
| 7 |
}; |
| 8 |
|
| 9 |
typedef unsigned char V __attribute__((vector_size (256))); |
| 10 |
#define TEN(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9 |
| 11 |
|
| 12 |
int |
| 13 |
main () |
| 14 |
{ |
| 15 |
if (__CHAR_BIT__ != 8) |
| 16 |
return 0; |
| 17 |
V a = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
| 18 |
TEN (1), TEN (2), TEN (3), TEN (4), |
| 19 |
TEN (5), TEN (6), TEN (7), TEN (8), |
| 20 |
TEN (9), TEN (10), TEN (11), TEN (12), |
| 21 |
TEN (13), TEN (14), TEN (15), TEN (16), |
| 22 |
TEN (17), TEN (18), TEN (19), TEN (20), |
| 23 |
TEN (21), TEN (22), TEN (23), TEN (24), |
| 24 |
250, 251, 252, 253, 254, 255 }; |
| 25 |
V b = __builtin_shufflevector (a, a, |
| 26 |
#embed <magna-carta.txt> limit (256) |
| 27 |
); |
| 28 |
V c = __builtin_shufflevector (b, b, |
| 29 |
#embed <magna-carta.txt> limit (256) |
| 30 |
); |
| 31 |
int i; |
| 32 |
for (i = 0; i < 256; ++i) |
| 33 |
if (b[i] != magna_carta[i]) |
| 34 |
__builtin_abort (); |
| 35 |
for (i = 0; i < 256; ++i) |
| 36 |
if (c[i] != magna_carta[magna_carta[i]]) |
| 37 |
__builtin_abort (); |
| 38 |
} |