Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2
3 #include <arm_sve.h>
4
5 #pragma GCC target ("arch=armv8.2-a+sve2")
6
7 void
8 f1 (svbool_t pg, svint8_t s8, svuint8_t u8,
9 svint16_t s16, svuint16_t u16,
10 svint32_t s32, svuint32_t u32,
11 svint64_t s64, svuint64_t u64,
12 svfloat32_t f32, int x)
13 {
14 const int one = 1;
15 svshrnb (u16); /* { dg-error {too few arguments to function 'svshrnb'} } */
16 svshrnb (u16, u16, 1); /* { dg-error {too many arguments to function 'svshrnb'} } */
17
18 svshrnb (u16, x); /* { dg-error {argument 2 of 'svshrnb' must be an integer constant expression} } */
19 svshrnb (u16, one); /* { dg-error {argument 2 of 'svshrnb' must be an integer constant expression} } */
20 svshrnb (u16, 0.4); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
21 svshrnb (u16, 1.0);
22
23 svshrnb (pg, 1); /* { dg-error {'svshrnb' has no form that takes 'svbool_t' arguments} } */
24
25 svshrnb (u8, -1); /* { dg-error {'svshrnb' has no form that takes 'svuint8_t' arguments} } */
26 svshrnb (u8, 1); /* { dg-error {'svshrnb' has no form that takes 'svuint8_t' arguments} } */
27 svshrnb (u8, 100); /* { dg-error {'svshrnb' has no form that takes 'svuint8_t' arguments} } */
28
29 svshrnb (s8, 1); /* { dg-error {'svshrnb' has no form that takes 'svint8_t' arguments} } */
30
31 svshrnb (u16, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
32 svshrnb (u16, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
33 svshrnb (u16, 1);
34 svshrnb (u16, 8);
35 svshrnb (u16, 9); /* { dg-error {passing 9 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
36
37 svshrnb (s16, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
38 svshrnb (s16, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
39 svshrnb (s16, 1);
40 svshrnb (s16, 8);
41 svshrnb (s16, 9); /* { dg-error {passing 9 to argument 2 of 'svshrnb', which expects a value in the range \[1, 8\]} } */
42
43 svshrnb (u32, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
44 svshrnb (u32, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
45 svshrnb (u32, 1);
46 svshrnb (u32, 16);
47 svshrnb (u32, 17); /* { dg-error {passing 17 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
48
49 svshrnb (s32, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
50 svshrnb (s32, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
51 svshrnb (s32, 1);
52 svshrnb (s32, 16);
53 svshrnb (s32, 17); /* { dg-error {passing 17 to argument 2 of 'svshrnb', which expects a value in the range \[1, 16\]} } */
54
55 svshrnb (u64, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
56 svshrnb (u64, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
57 svshrnb (u64, 1);
58 svshrnb (u64, 32);
59 svshrnb (u64, 33); /* { dg-error {passing 33 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
60
61 svshrnb (s64, -1); /* { dg-error {passing -1 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
62 svshrnb (s64, 0); /* { dg-error {passing 0 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
63 svshrnb (s64, 1);
64 svshrnb (s64, 32);
65 svshrnb (s64, 33); /* { dg-error {passing 33 to argument 2 of 'svshrnb', which expects a value in the range \[1, 32\]} } */
66
67 svshrnb (f32, 1); /* { dg-error {'svshrnb' has no form that takes 'svfloat32_t' arguments} } */
68
69 svshrnb (1, 1); /* { dg-error {passing 'int' to argument 1 of 'svshrnb', which expects an SVE type rather than a scalar} } */
70 }