Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowt_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 svshrnt (u8, u16); /* { dg-error {too few arguments to function 'svshrnt'} } */
16 svshrnt (u8, u16, u16, 1); /* { dg-error {too many arguments to function 'svshrnt'} } */
17
18 svshrnt (u16, u16, 1); /* { dg-error {passing 'svuint16_t' instead of the expected 'svuint8_t' to argument 1 of 'svshrnt', after passing 'svuint16_t' to argument 2} } */
19 svshrnt (s16, u16, 1); /* { dg-error {passing 'svint16_t' instead of the expected 'svuint8_t' to argument 1 of 'svshrnt', after passing 'svuint16_t' to argument 2} } */
20 svshrnt (s8, u16, 1); /* { dg-error {arguments 1 and 2 of 'svshrnt' must have the same signedness, but the values passed here have type 'svint8_t' and 'svuint16_t' respectively} } */
21 svshrnt (pg, u16, 1); /* { dg-error {passing 'svbool_t' instead of the expected 'svuint8_t' to argument 1 of 'svshrnt', after passing 'svuint16_t' to argument 2} } */
22
23 svshrnt (s16, s16, 1); /* { dg-error {passing 'svint16_t' instead of the expected 'svint8_t' to argument 1 of 'svshrnt', after passing 'svint16_t' to argument 2} } */
24 svshrnt (u16, s16, 1); /* { dg-error {passing 'svuint16_t' instead of the expected 'svint8_t' to argument 1 of 'svshrnt', after passing 'svint16_t' to argument 2} } */
25 svshrnt (u8, s16, 1); /* { dg-error {arguments 1 and 2 of 'svshrnt' must have the same signedness, but the values passed here have type 'svuint8_t' and 'svint16_t' respectively} } */
26 svshrnt (pg, s16, 1); /* { dg-error {passing 'svbool_t' instead of the expected 'svint8_t' to argument 1 of 'svshrnt', after passing 'svint16_t' to argument 2} } */
27
28 svshrnt (u8, u16, x); /* { dg-error {argument 3 of 'svshrnt' must be an integer constant expression} } */
29 svshrnt (u8, u16, one); /* { dg-error {argument 3 of 'svshrnt' must be an integer constant expression} } */
30 svshrnt (u8, u16, 0.4); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
31 svshrnt (u8, u16, 1.0);
32
33 svshrnt (pg, pg, 1); /* { dg-error {'svshrnt' has no form that takes 'svbool_t' arguments} } */
34
35 svshrnt (u8, u8, -1); /* { dg-error {'svshrnt' has no form that takes 'svuint8_t' arguments} } */
36 svshrnt (u8, u8, 1); /* { dg-error {'svshrnt' has no form that takes 'svuint8_t' arguments} } */
37 svshrnt (u8, u8, 100); /* { dg-error {'svshrnt' has no form that takes 'svuint8_t' arguments} } */
38
39 svshrnt (s8, s8, 1); /* { dg-error {'svshrnt' has no form that takes 'svint8_t' arguments} } */
40
41 svshrnt (u8, u16, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
42 svshrnt (u8, u16, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
43 svshrnt (u8, u16, 1);
44 svshrnt (u8, u16, 8);
45 svshrnt (u8, u16, 9); /* { dg-error {passing 9 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
46
47 svshrnt (s8, s16, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
48 svshrnt (s8, s16, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
49 svshrnt (s8, s16, 1);
50 svshrnt (s8, s16, 8);
51 svshrnt (s8, s16, 9); /* { dg-error {passing 9 to argument 3 of 'svshrnt', which expects a value in the range \[1, 8\]} } */
52
53 svshrnt (u16, u32, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
54 svshrnt (u16, u32, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
55 svshrnt (u16, u32, 1);
56 svshrnt (u16, u32, 16);
57 svshrnt (u16, u32, 17); /* { dg-error {passing 17 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
58
59 svshrnt (s16, s32, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
60 svshrnt (s16, s32, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
61 svshrnt (s16, s32, 1);
62 svshrnt (s16, s32, 16);
63 svshrnt (s16, s32, 17); /* { dg-error {passing 17 to argument 3 of 'svshrnt', which expects a value in the range \[1, 16\]} } */
64
65 svshrnt (u32, u64, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
66 svshrnt (u32, u64, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
67 svshrnt (u32, u64, 1);
68 svshrnt (u32, u64, 32);
69 svshrnt (u32, u64, 33); /* { dg-error {passing 33 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
70
71 svshrnt (s32, s64, -1); /* { dg-error {passing -1 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
72 svshrnt (s32, s64, 0); /* { dg-error {passing 0 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
73 svshrnt (s32, s64, 1);
74 svshrnt (s32, s64, 32);
75 svshrnt (s32, s64, 33); /* { dg-error {passing 33 to argument 3 of 'svshrnt', which expects a value in the range \[1, 32\]} } */
76
77 svshrnt (f32, f32, 1); /* { dg-error {'svshrnt' has no form that takes 'svfloat32_t' arguments} } */
78
79 svshrnt (1, s32, 1); /* { dg-error {passing 'int' to argument 1 of 'svshrnt', which expects an SVE type rather than a scalar} } */
80 svshrnt (s32, 1, 1); /* { dg-error {passing 'int' to argument 2 of 'svshrnt', which expects an SVE type rather than a scalar} } */
81 }