| 1 |
/* PR target/84220 */ |
| 2 |
/* Test to ensure we generate invalid parameter errors rather than an ICE |
| 3 |
when calling builtin_vec_sldw() with invalid parameters. */ |
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-mvsx" } */ |
| 6 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
typedef vector bool char vbc_t; |
| 11 |
typedef vector signed char vsc_t; |
| 12 |
typedef vector unsigned char vuc_t; |
| 13 |
typedef vector bool int vbi_t; |
| 14 |
typedef vector signed int vsi_t; |
| 15 |
typedef vector unsigned int vui_t; |
| 16 |
typedef vector pixel vp_t; |
| 17 |
typedef vector bool short vbs_t; |
| 18 |
typedef vector signed short vss_t; |
| 19 |
typedef vector unsigned short vus_t; |
| 20 |
typedef vector float vf_t; |
| 21 |
typedef vector bool long long vbl_t; |
| 22 |
typedef vector signed long long vsl_t; |
| 23 |
typedef vector unsigned long long vul_t; |
| 24 |
typedef vector double vd_t; |
| 25 |
|
| 26 |
void |
| 27 |
test_vsc ( vsc_t v1, vsc_t v2, vsc_t v3 ) \ |
| 28 |
{ |
| 29 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 30 |
vec_sldw(v1, v2, 3); |
| 31 |
} |
| 32 |
|
| 33 |
void |
| 34 |
test_vuc ( vuc_t v1, vuc_t v2, vuc_t v3 ) \ |
| 35 |
{ |
| 36 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 37 |
vec_sldw(v1, v2, 3); |
| 38 |
} |
| 39 |
|
| 40 |
void |
| 41 |
test_vsi ( vsi_t v1, vsi_t v2, vsi_t v3 ) \ |
| 42 |
{ |
| 43 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 44 |
vec_sldw(v1, v2, 3); |
| 45 |
} |
| 46 |
|
| 47 |
void |
| 48 |
test_vui ( vui_t v1, vui_t v2, vui_t v3 ) \ |
| 49 |
{ |
| 50 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 51 |
vec_sldw(v1, v2, 3); |
| 52 |
} |
| 53 |
|
| 54 |
void |
| 55 |
test_vsl ( vsl_t v1, vsl_t v2, vsl_t v3 ) \ |
| 56 |
{ |
| 57 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 58 |
vec_sldw(v1, v2, 3); |
| 59 |
} |
| 60 |
|
| 61 |
void |
| 62 |
test_vul ( vul_t v1, vul_t v2, vul_t v3 ) \ |
| 63 |
{ |
| 64 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 65 |
vec_sldw(v1, v2, 3); |
| 66 |
} |
| 67 |
|
| 68 |
void |
| 69 |
test_vss ( vss_t v1, vss_t v2, vss_t v3 ) \ |
| 70 |
{ |
| 71 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 72 |
vec_sldw(v1, v2, 3); |
| 73 |
} |
| 74 |
|
| 75 |
void |
| 76 |
test_vus ( vus_t v1, vus_t v2, vus_t v3 ) \ |
| 77 |
{ |
| 78 |
vec_sldw(v1, v2, v3); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */ |
| 79 |
vec_sldw(v1, v2, 3); |
| 80 |
} |