| 1 |
/* Verify that overloaded built-ins for vec_splat_s8 and vec_splat_s16 |
| 2 |
generate errors as expected when we attempt to use invalid inputs. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-mvsx -O2" } */ |
| 6 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
vector signed short |
| 11 |
testss_1 (unsigned int ui) |
| 12 |
{ |
| 13 |
return vec_splat_s16 (ui);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */ |
| 14 |
} |
| 15 |
|
| 16 |
vector unsigned short |
| 17 |
testss_2 (signed int si) |
| 18 |
{ |
| 19 |
return vec_splat_u16 (si);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */ |
| 20 |
} |
| 21 |
|
| 22 |
vector signed char |
| 23 |
testsc_1 (unsigned int ui) |
| 24 |
{ |
| 25 |
return vec_splat_s8 (ui); /* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */ |
| 26 |
} |
| 27 |
|
| 28 |
vector unsigned char |
| 29 |
testsc_2 (signed int si) |
| 30 |
{ |
| 31 |
return vec_splat_u8 (si);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */ |
| 32 |
} |
| 33 |
|