Debian Codegraph @

gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/asrd_1.C

raw
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, svuint8_t u8, svint8_t s8, svint16_t s16,
11 svint32_t s32, svint64_t s64, int x)
12 {
13 const int one = 1;
14 u8 = svasrd_x (pg, u8, 1); /* { dg-error {no matching function for call to 'svasrd_x\(svbool_t&, svuint8_t&, [^)]*\)'} } */
15 s8 = svasrd_x (pg, s8, x); /* { dg-error "argument 3 of 'svasrd_x' must be an integer constant expression" } */
16 s8 = svasrd_x (pg, s8, one);
17 s8 = svasrd_x (pg, s8, 0.4); /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} } */
18 s8 = svasrd_x (pg, s8, 1.0);
19 s8 = svasrd_x (pg, s8, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} } */
20 s8 = svasrd_x (pg, s8, 1);
21 s8 = svasrd_x (pg, s8, 1 + 1);
22 s8 = svasrd_x (pg, s8, const_add (1, 1));
23 s8 = svasrd_x (pg, s8, add (1, 1)); /* { dg-error "argument 3 of 'svasrd_x' must be an integer constant expression" } */
24 s8 = svasrd_x (pg, s8, 8);
25 s8 = svasrd_x (pg, s8, 9); /* { dg-error {passing 9 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} } */
26 s8 = svasrd_x (pg, s8, (uint64_t (1) << 62) + 1); /* { dg-error {passing [^ ]* to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} } */
27 s16 = svasrd_x (pg, s16, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 16\]} } */
28 s16 = svasrd_x (pg, s16, 1);
29 s16 = svasrd_x (pg, s16, 16);
30 s16 = svasrd_x (pg, s16, 17); /* { dg-error {passing 17 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 16\]} } */
31 s32 = svasrd_x (pg, s32, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 32\]} } */
32 s32 = svasrd_x (pg, s32, 1);
33 s32 = svasrd_x (pg, s32, 32);
34 s32 = svasrd_x (pg, s32, 33); /* { dg-error {passing 33 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 32\]} } */
35 s64 = svasrd_x (pg, s64, 0); /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 64\]} } */
36 s64 = svasrd_x (pg, s64, 1);
37 s64 = svasrd_x (pg, s64, 64);
38 s64 = svasrd_x (pg, s64, 65); /* { dg-error {passing 65 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 64\]} } */
39 }