Debian Codegraph @

gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/get4_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_sub (uint64_t a, uint64_t b) { return a - b; }
7 uint64_t add (uint64_t a, uint64_t b) { return a + b; }
8
9 svfloat64_t
10 f1 (svbool_t pg, svint32_t s32, svint32x4_t s32x4, svint32x2_t s32x2, int x)
11 {
12 const int one = 1;
13 svfloat64_t f64;
14
15 s32 = svget4 (s32x4); /* { dg-error {no matching function for call to 'svget4\(svint32x4_t\&\)'} } */
16 s32 = svget4 (s32x4, 1, 2); /* { dg-error {no matching function for call to 'svget4\(svint32x4_t\&, int, int\)'} } */
17 s32 = svget4 (s32, 0); /* { dg-error {no matching function for call to 'svget4\(svint32_t\&, int\)'} } */
18 s32 = svget4 (s32x2, 0); /* { dg-error {no matching function for call to 'svget4\(svint32x2_t\&, int\)'} } */
19 s32 = svget4 (pg, 0); /* { dg-error {no matching function for call to 'svget4\(svbool_t\&, int\)'} } */
20 s32 = svget4 (s32x4, x); /* { dg-error "argument 2 of 'svget4' must be an integer constant expression" } */
21 s32 = svget4 (s32x4, 0);
22 f64 = svget4 (s32x4, 0); /* { dg-error "cannot convert 'svint32_t' to 'svfloat64_t' in assignment" } */
23 s32 = svget4 (s32x4, 1);
24 s32 = svget4 (s32x4, 2);
25 s32 = svget4 (s32x4, 3);
26 s32 = svget4 (s32x4, 4); /* { dg-error {passing 4 to argument 2 of 'svget4', which expects a value in the range \[0, 3\]} } */
27 s32 = svget4 (s32x4, 5); /* { dg-error {passing 5 to argument 2 of 'svget4', which expects a value in the range \[0, 3\]} } */
28 s32 = svget4 (s32x4, ~0U); /* { dg-error {passing [^ ]* to argument 2 of 'svget4', which expects a value in the range \[0, 3\]} } */
29 s32 = svget4 (s32x4, one);
30 s32 = svget4 (s32x4, 3 - 2);
31 s32 = svget4 (s32x4, 1.0);
32 s32 = svget4 (s32x4, const_sub (5, 4));
33 s32 = svget4 (s32x4, const_sub (6, 4));
34 s32 = svget4 (s32x4, const_sub (7, 4));
35 s32 = svget4 (s32x4, const_sub (8, 4)); /* { dg-error {passing 4 to argument 2 of 'svget4', which expects a value in the range \[0, 3\]} } */
36 s32 = svget4 (s32x4, add (0, 0)); /* { dg-error "argument 2 of 'svget4' must be an integer constant expression" } */
37
38 return f64;
39 }