| 1 |
/* { dg-do run } */ |
| 2 |
/* PR target/101529 */ |
| 3 |
|
| 4 |
typedef unsigned char __attribute__((__vector_size__ (1))) W; |
| 5 |
typedef unsigned char __attribute__((__vector_size__ (8))) V; |
| 6 |
typedef unsigned short __attribute__((__vector_size__ (16))) U; |
| 7 |
|
| 8 |
unsigned short us; |
| 9 |
|
| 10 |
/* aarch64 used to miscompile foo to just return 0. */ |
| 11 |
W |
| 12 |
foo (unsigned char uc) |
| 13 |
{ |
| 14 |
V v = __builtin_convertvector ((U){ } >= us, V); |
| 15 |
return __builtin_shufflevector ((W){ }, v, 4) & uc; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
main (void) |
| 20 |
{ |
| 21 |
W x = foo (5); |
| 22 |
if (x[0] != 5) |
| 23 |
__builtin_abort(); |
| 24 |
return 0; |
| 25 |
} |
| 26 |
|