| 1 |
/* PR target/101384 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -Wno-psabi -w" } */ |
| 4 |
|
| 5 |
typedef unsigned char __attribute__((__vector_size__ (16))) U; |
| 6 |
typedef unsigned short __attribute__((__vector_size__ (8 * sizeof (short)))) V; |
| 7 |
|
| 8 |
U u; |
| 9 |
V v; |
| 10 |
|
| 11 |
__attribute__((noipa)) U |
| 12 |
foo (void) |
| 13 |
{ |
| 14 |
U y = (U) { 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, |
| 15 |
0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff } + u; |
| 16 |
return y; |
| 17 |
} |
| 18 |
|
| 19 |
__attribute__((noipa)) V |
| 20 |
bar (void) |
| 21 |
{ |
| 22 |
V y = (V) { 0x8000, 0xffff, 0x8000, 0xffff, |
| 23 |
0x8000, 0xffff, 0x8000, 0xffff } + v; |
| 24 |
return y; |
| 25 |
} |
| 26 |
|
| 27 |
int |
| 28 |
main () |
| 29 |
{ |
| 30 |
U x = foo (); |
| 31 |
for (unsigned i = 0; i < 16; i++) |
| 32 |
if (x[i] != ((i & 3) ? 0xff : 0x80)) |
| 33 |
__builtin_abort (); |
| 34 |
V y = bar (); |
| 35 |
for (unsigned i = 0; i < 8; i++) |
| 36 |
if (y[i] != ((i & 1) ? 0xffff : 0x8000)) |
| 37 |
__builtin_abort (); |
| 38 |
return 0; |
| 39 |
} |