Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_2.c

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