comparison gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/asrd_3.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
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 template<uint64_t N, typename T>
10 T shift (svbool_t pg, T v) { return svasrd_x (pg, v, N); }
11 /* { dg-error {no matching function for call to 'svasrd_x\(svbool_t&,} "" { target *-*-* } .-1 } */
12 /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} "" { target *-*-* } .-2 } */
13 /* { dg-error {passing 9 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 8\]} "" { target *-*-* } .-3 } */
14 /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 16\]} "" { target *-*-* } .-4 } */
15 /* { dg-error {passing 17 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 16\]} "" { target *-*-* } .-5 } */
16 /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 32\]} "" { target *-*-* } .-6 } */
17 /* { dg-error {passing 33 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 32\]} "" { target *-*-* } .-7 } */
18 /* { dg-error {passing 0 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 64\]} "" { target *-*-* } .-8 } */
19 /* { dg-error {passing 65 to argument 3 of 'svasrd_x', which expects a value in the range \[1, 64\]} "" { target *-*-* } .-9 } */
20
21 template<typename T>
22 T shift1 (svbool_t pg, T v, uint64_t n) { return svasrd_x (pg, v, n); }
23
24 template<typename T>
25 T shift2 (svbool_t pg, T v, uint64_t n) { return svasrd_x (pg, v, n); }
26 /* { dg-error {argument 3 of 'svasrd_x' must be an integer constant expression} "" { target *-*-* } .-1 } */
27
28 void
29 f1 (svbool_t pg, svuint8_t u8, svint8_t s8, svint16_t s16,
30 svint32_t s32, svint64_t s64)
31 {
32 u8 = shift <1> (pg, u8);
33 s8 = shift <0> (pg, s8);
34 s8 = shift <1> (pg, s8);
35 s8 = shift <8> (pg, s8);
36 s8 = shift <9> (pg, s8);
37 s16 = shift <0> (pg, s16);
38 s16 = shift <1> (pg, s16);
39 s16 = shift <16> (pg, s16);
40 s16 = shift <17> (pg, s16);
41 s32 = shift <0> (pg, s32);
42 s32 = shift <1> (pg, s32);
43 s32 = shift <32> (pg, s32);
44 s32 = shift <33> (pg, s32);
45 s64 = shift <0> (pg, s64);
46 s64 = shift <1> (pg, s64);
47 s64 = shift <64> (pg, s64);
48 s64 = shift <65> (pg, s64);
49
50 s8 = shift2 (pg, s8, 1);
51 }