Debian Codegraph @

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