| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-std=c++11 -Wall -Wextra" } */ |
| 3 |
|
| 4 |
#include <arm_sve.h> |
| 5 |
|
| 6 |
constexpr uint64_t const_add (uint64_t a, uint64_t b) { return a + b; } |
| 7 |
uint64_t add (uint64_t a, uint64_t b) { return a + b; } |
| 8 |
|
| 9 |
void |
| 10 |
f1 (svbool_t pg, svint8_t s8, svint16_t s16, svint32_t s32, svint64_t s64, |
| 11 |
int x) |
| 12 |
{ |
| 13 |
const int one = 1; |
| 14 |
s8 = svasrd_n_s8_x (pg, s8, x); /* { dg-error "argument 3 of 'svasrd_n_s8_x' must be an integer constant expression" } */ |
| 15 |
s8 = svasrd_n_s8_x (pg, s8, one); |
| 16 |
s8 = svasrd_n_s8_x (pg, s8, 0.4); /* { dg-error {passing 0 to argument 3 of 'svasrd_n_s8_x', which expects a value in the range \[1, 8\]} } */ |
| 17 |
s8 = svasrd_n_s8_x (pg, s8, 1.0); |
| 18 |
s8 = svasrd_n_s8_x (pg, s8, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_n_s8_x', which expects a value in the range \[1, 8\]} } */ |
| 19 |
s8 = svasrd_n_s8_x (pg, s8, 1); |
| 20 |
s8 = svasrd_n_s8_x (pg, s8, 1 + 1); |
| 21 |
s8 = svasrd_n_s8_x (pg, s8, const_add (1, 1)); |
| 22 |
s8 = svasrd_n_s8_x (pg, s8, add (1, 1)); /* { dg-error "argument 3 of 'svasrd_n_s8_x' must be an integer constant expression" } */ |
| 23 |
s8 = svasrd_n_s8_x (pg, s8, 8); |
| 24 |
s8 = svasrd_n_s8_x (pg, s8, 9); /* { dg-error {passing 9 to argument 3 of 'svasrd_n_s8_x', which expects a value in the range \[1, 8\]} } */ |
| 25 |
s8 = svasrd_n_s8_x (pg, s8, (uint64_t (1) << 62) + 1); /* { dg-error {passing [^ ]* to argument 3 of 'svasrd_n_s8_x', which expects a value in the range \[1, 8\]} } */ |
| 26 |
s16 = svasrd_n_s16_x (pg, s16, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_n_s16_x', which expects a value in the range \[1, 16\]} } */ |
| 27 |
s16 = svasrd_n_s16_x (pg, s16, 1); |
| 28 |
s16 = svasrd_n_s16_x (pg, s16, 16); |
| 29 |
s16 = svasrd_n_s16_x (pg, s16, 17); /* { dg-error {passing 17 to argument 3 of 'svasrd_n_s16_x', which expects a value in the range \[1, 16\]} } */ |
| 30 |
s32 = svasrd_n_s32_x (pg, s32, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_n_s32_x', which expects a value in the range \[1, 32\]} } */ |
| 31 |
s32 = svasrd_n_s32_x (pg, s32, 1); |
| 32 |
s32 = svasrd_n_s32_x (pg, s32, 32); |
| 33 |
s32 = svasrd_n_s32_x (pg, s32, 33); /* { dg-error {passing 33 to argument 3 of 'svasrd_n_s32_x', which expects a value in the range \[1, 32\]} } */ |
| 34 |
s64 = svasrd_n_s64_x (pg, s64, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_n_s64_x', which expects a value in the range \[1, 64\]} } */ |
| 35 |
s64 = svasrd_n_s64_x (pg, s64, 1); |
| 36 |
s64 = svasrd_n_s64_x (pg, s64, 64); |
| 37 |
s64 = svasrd_n_s64_x (pg, s64, 65); /* { dg-error {passing 65 to argument 3 of 'svasrd_n_s64_x', which expects a value in the range \[1, 64\]} } */ |
| 38 |
} |