Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-std=c99 -Wall -Wextra" } */
3
4 #include <arm_sve.h>
5
6 #pragma GCC target ("arch=armv8.2-a+sve2")
7
8 void
9 f1 (svbool_t pg, svuint8_t u8, svint8_t s8, svint16_t s16,
10 svint32_t s32, svint64_t s64, int x)
11 {
12 const int one = 1;
13 pg = svsra (pg, pg, 1); /* { dg-error {'svsra' has no form that takes 'svbool_t' arguments} } */
14 pg = svsra (pg, s8, 1); /* { dg-error {passing 'svint8_t' to argument 2 of 'svsra', but argument 1 had type 'svbool_t'} } */
15 s8 = svsra (1, s8, 1); /* { dg-error {passing 'int' to argument 1 of 'svsra', which expects an SVE type rather than a scalar} } */
16 s8 = svsra (s8, u8, 1); /* { dg-error {passing 'svuint8_t' to argument 2 of 'svsra', but argument 1 had type 'svint8_t'} } */
17 s8 = svsra (s8, pg, 1); /* { dg-error {passing 'svbool_t' to argument 2 of 'svsra', but argument 1 had type 'svint8_t'} } */
18 s8 = svsra (s8, 1, 1); /* { dg-error {passing 'int' to argument 2 of 'svsra', which expects an SVE type rather than a scalar} } */
19 s8 = svsra (s8, s8, x); /* { dg-error {argument 3 of 'svsra' must be an integer constant expression} } */
20 s8 = svsra (s8, s8, one); /* { dg-error {argument 3 of 'svsra' must be an integer constant expression} } */
21 s8 = svsra (s8, s8, 0.4); /* { dg-error {passing 0 to argument 3 of 'svsra', which expects a value in the range \[1, 8\]} } */
22 s8 = svsra (s8, s8, 1.0);
23 s8 = svsra (s8, s8, 0); /* { dg-error {passing 0 to argument 3 of 'svsra', which expects a value in the range \[1, 8\]} } */
24 s8 = svsra (s8, s8, 1);
25 s8 = svsra (s8, s8, 1 + 1);
26 s8 = svsra (s8, s8, 8);
27 s8 = svsra (s8, s8, 9); /* { dg-error {passing 9 to argument 3 of 'svsra', which expects a value in the range \[1, 8\]} } */
28 s8 = svsra (s8, s8, (1ULL << 62) + 1); /* { dg-error {passing [^ ]* to argument 3 of 'svsra', which expects a value in the range \[1, 8\]} } */
29 s16 = svsra (s16, s16, 0); /* { dg-error {passing 0 to argument 3 of 'svsra', which expects a value in the range \[1, 16\]} } */
30 s16 = svsra (s16, s16, 1);
31 s16 = svsra (s16, s16, 16);
32 s16 = svsra (s16, s16, 17); /* { dg-error {passing 17 to argument 3 of 'svsra', which expects a value in the range \[1, 16\]} } */
33 s32 = svsra (s32, s32, 0); /* { dg-error {passing 0 to argument 3 of 'svsra', which expects a value in the range \[1, 32\]} } */
34 s32 = svsra (s32, s32, 1);
35 s32 = svsra (s32, s32, 32);
36 s32 = svsra (s32, s32, 33); /* { dg-error {passing 33 to argument 3 of 'svsra', which expects a value in the range \[1, 32\]} } */
37 s64 = svsra (s64, s64, 0); /* { dg-error {passing 0 to argument 3 of 'svsra', which expects a value in the range \[1, 64\]} } */
38 s64 = svsra (s64, s64, 1);
39 s64 = svsra (s64, s64, 64);
40 s64 = svsra (s64, s64, 65); /* { dg-error {passing 65 to argument 3 of 'svsra', which expects a value in the range \[1, 64\]} } */
41 }