| 1 |
// { dg-options "-msve-vector-bits=256 -std=gnu++2a -flax-vector-conversions" } |
| 2 |
|
| 3 |
#include <arm_sve.h> |
| 4 |
|
| 5 |
typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); |
| 6 |
typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); |
| 7 |
|
| 8 |
void |
| 9 |
f (svuint8_t sve_u1, svint8_t sve_s1, |
| 10 |
gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) |
| 11 |
{ |
| 12 |
// Initialization |
| 13 |
|
| 14 |
svuint8_t init_sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } |
| 15 |
svuint8_t init_sve_u2 = {}; |
| 16 |
svuint8_t init_sve_u3 = { sve_u1 }; |
| 17 |
svuint8_t init_sve_u4 = { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 18 |
svuint8_t init_sve_u5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 19 |
svuint8_t init_sve_u6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 20 |
svuint8_t init_sve_u7 = { 0 }; |
| 21 |
svuint8_t init_sve_u8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 22 |
svuint8_t init_sve_u9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 23 |
svuint8_t init_sve_u10 {}; |
| 24 |
svuint8_t init_sve_u11 { sve_u1 }; |
| 25 |
svuint8_t init_sve_u12 { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 26 |
svuint8_t init_sve_u13 { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 27 |
svuint8_t init_sve_u14 { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 28 |
svuint8_t init_sve_u15 { 0 }; |
| 29 |
svuint8_t init_sve_u16 { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 30 |
svuint8_t init_sve_u17 { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 31 |
svuint8_t init_sve_u18 (0); // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } |
| 32 |
svuint8_t init_sve_u19 (sve_u1); |
| 33 |
svuint8_t init_sve_u20 (gnu_u1); |
| 34 |
svuint8_t init_sve_u21 (sve_s1); |
| 35 |
svuint8_t init_sve_u22 (gnu_s1); |
| 36 |
|
| 37 |
gnu_uint8_t init_gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } |
| 38 |
gnu_uint8_t init_gnu_u2 = {}; |
| 39 |
gnu_uint8_t init_gnu_u3 = { sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 40 |
gnu_uint8_t init_gnu_u4 = { gnu_u1 }; |
| 41 |
gnu_uint8_t init_gnu_u5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 42 |
gnu_uint8_t init_gnu_u6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 43 |
gnu_uint8_t init_gnu_u7 = { 0 }; |
| 44 |
gnu_uint8_t init_gnu_u8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 45 |
gnu_uint8_t init_gnu_u9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 46 |
gnu_uint8_t init_gnu_u10 { sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 47 |
gnu_uint8_t init_gnu_u11 { gnu_u1 }; |
| 48 |
gnu_uint8_t init_gnu_u12 { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 49 |
gnu_uint8_t init_gnu_u13 { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 50 |
gnu_uint8_t init_gnu_u14 { 0 }; |
| 51 |
gnu_uint8_t init_gnu_u15 { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 52 |
gnu_uint8_t init_gnu_u16 { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 53 |
gnu_uint8_t init_gnu_u17 (0); // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } |
| 54 |
gnu_uint8_t init_gnu_u18 (sve_u1); |
| 55 |
gnu_uint8_t init_gnu_u19 (gnu_u1); |
| 56 |
gnu_uint8_t init_gnu_u20 (sve_s1); |
| 57 |
gnu_uint8_t init_gnu_u21 (gnu_s1); |
| 58 |
|
| 59 |
// Compound literals |
| 60 |
|
| 61 |
(svuint8_t) {}; |
| 62 |
(svuint8_t) { 0 }; |
| 63 |
(svuint8_t) { sve_u1 }; |
| 64 |
(svuint8_t) { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 65 |
(svuint8_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 66 |
(svuint8_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 67 |
(svuint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 68 |
(svuint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 69 |
|
| 70 |
(gnu_uint8_t) {}; |
| 71 |
(gnu_uint8_t) { 0 }; |
| 72 |
(gnu_uint8_t) { sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 73 |
(gnu_uint8_t) { gnu_u1 }; |
| 74 |
(gnu_uint8_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } |
| 75 |
(gnu_uint8_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } |
| 76 |
(gnu_uint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } |
| 77 |
(gnu_uint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } |
| 78 |
|
| 79 |
// Assignment |
| 80 |
|
| 81 |
sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in assignment} } |
| 82 |
sve_u1 = sve_u1; |
| 83 |
sve_u1 = gnu_u1; |
| 84 |
sve_u1 = sve_s1; |
| 85 |
sve_u1 = gnu_s1; |
| 86 |
|
| 87 |
gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in assignment} } |
| 88 |
gnu_u1 = sve_u1; |
| 89 |
gnu_u1 = gnu_u1; |
| 90 |
gnu_u1 = sve_s1; |
| 91 |
gnu_u1 = gnu_s1; |
| 92 |
|
| 93 |
// Casts |
| 94 |
|
| 95 |
(void) sve_u1; |
| 96 |
(int) sve_u1; // { dg-error {cannot convert a vector of type 'svuint8_t' to type 'int'} } |
| 97 |
(bool) sve_u1; // { dg-error {cannot convert a vector of type 'svuint8_t' to type 'bool'} } |
| 98 |
(svuint8_t) 0; // { dg-error {cannot convert a value of type 'int' to vector type 'svuint8_t'} } |
| 99 |
(svuint8_t) n; // { dg-error {cannot convert a value of type 'int' to vector type 'svuint8_t'} } |
| 100 |
(svuint8_t) sve_u1; |
| 101 |
(svuint8_t) gnu_u1; |
| 102 |
(svuint8_t) sve_s1; |
| 103 |
(svuint8_t) gnu_s1; |
| 104 |
|
| 105 |
(void) gnu_u1; |
| 106 |
(int) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'int'} } |
| 107 |
(bool) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'bool'} } |
| 108 |
(gnu_uint8_t) 0; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } |
| 109 |
(gnu_uint8_t) n; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } |
| 110 |
(gnu_uint8_t) sve_u1; |
| 111 |
(gnu_uint8_t) gnu_u1; |
| 112 |
(gnu_uint8_t) sve_s1; |
| 113 |
(gnu_uint8_t) gnu_s1; |
| 114 |
|
| 115 |
// Vector indexing. |
| 116 |
|
| 117 |
sve_u1[0]; |
| 118 |
&sve_u1[0]; |
| 119 |
|
| 120 |
gnu_u1[0]; |
| 121 |
&gnu_u1[0]; |
| 122 |
|
| 123 |
// Unary vector arithmetic. |
| 124 |
|
| 125 |
+sve_u1; |
| 126 |
-sve_u1; |
| 127 |
~sve_u1; |
| 128 |
!sve_u1; |
| 129 |
|
| 130 |
*sve_u1; // { dg-error {invalid type argument of unary '\*'} } |
| 131 |
__real sve_u1; // { dg-error {wrong type argument to __real} } |
| 132 |
__imag sve_u1; // { dg-error {wrong type argument to __imag} } |
| 133 |
++sve_u1; |
| 134 |
--sve_u1; |
| 135 |
sve_u1++; |
| 136 |
sve_u1--; |
| 137 |
|
| 138 |
+gnu_u1; |
| 139 |
-gnu_u1; |
| 140 |
~gnu_u1; |
| 141 |
!gnu_u1; |
| 142 |
*gnu_u1; // { dg-error {invalid type argument of unary '\*'} } |
| 143 |
__real gnu_u1; // { dg-error {wrong type argument to __real} } |
| 144 |
__imag gnu_u1; // { dg-error {wrong type argument to __imag} } |
| 145 |
++gnu_u1; |
| 146 |
--gnu_u1; |
| 147 |
gnu_u1++; |
| 148 |
gnu_u1--; |
| 149 |
|
| 150 |
// Vector-vector binary arithmetic. |
| 151 |
|
| 152 |
sve_u1 + sve_u1; |
| 153 |
sve_u1 - sve_u1; |
| 154 |
sve_u1 * sve_u1; |
| 155 |
sve_u1 / sve_u1; |
| 156 |
sve_u1 % sve_u1; |
| 157 |
sve_u1 & sve_u1; |
| 158 |
sve_u1 | sve_u1; |
| 159 |
sve_u1 ^ sve_u1; |
| 160 |
sve_u1 == sve_u1; |
| 161 |
sve_u1 != sve_u1; |
| 162 |
sve_u1 <= sve_u1; |
| 163 |
sve_u1 < sve_u1; |
| 164 |
sve_u1 > sve_u1; |
| 165 |
sve_u1 >= sve_u1; |
| 166 |
sve_u1 <=> sve_u1; // { dg-message {three-way comparison of vectors} } |
| 167 |
sve_u1 << sve_u1; |
| 168 |
sve_u1 >> sve_u1; |
| 169 |
sve_u1 && sve_u1; |
| 170 |
sve_u1 || sve_u1; |
| 171 |
|
| 172 |
sve_u1 + gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 173 |
sve_u1 - gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 174 |
sve_u1 * gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 175 |
sve_u1 / gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 176 |
sve_u1 % gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 177 |
sve_u1 & gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 178 |
sve_u1 | gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 179 |
sve_u1 ^ gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 180 |
sve_u1 == gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 181 |
sve_u1 != gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 182 |
sve_u1 <= gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 183 |
sve_u1 < gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 184 |
sve_u1 > gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 185 |
sve_u1 >= gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 186 |
sve_u1 <=> gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 187 |
sve_u1 << gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 188 |
sve_u1 >> gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 189 |
sve_u1 && gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 190 |
sve_u1 || gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 191 |
|
| 192 |
gnu_u1 + sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 193 |
gnu_u1 - sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 194 |
gnu_u1 * sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 195 |
gnu_u1 / sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 196 |
gnu_u1 % sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 197 |
gnu_u1 & sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 198 |
gnu_u1 | sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 199 |
gnu_u1 ^ sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 200 |
gnu_u1 == sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 201 |
gnu_u1 != sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 202 |
gnu_u1 <= sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 203 |
gnu_u1 < sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 204 |
gnu_u1 > sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 205 |
gnu_u1 >= sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 206 |
gnu_u1 <=> sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 207 |
gnu_u1 << sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 208 |
gnu_u1 >> sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 209 |
gnu_u1 && sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 210 |
gnu_u1 || sve_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 211 |
|
| 212 |
gnu_u1 + gnu_u1; |
| 213 |
gnu_u1 - gnu_u1; |
| 214 |
gnu_u1 * gnu_u1; |
| 215 |
gnu_u1 / gnu_u1; |
| 216 |
gnu_u1 % gnu_u1; |
| 217 |
gnu_u1 & gnu_u1; |
| 218 |
gnu_u1 | gnu_u1; |
| 219 |
gnu_u1 ^ gnu_u1; |
| 220 |
gnu_u1 == gnu_u1; |
| 221 |
gnu_u1 != gnu_u1; |
| 222 |
gnu_u1 <= gnu_u1; |
| 223 |
gnu_u1 < gnu_u1; |
| 224 |
gnu_u1 > gnu_u1; |
| 225 |
gnu_u1 >= gnu_u1; |
| 226 |
// This is a target-independent sorry. There's no ACLE reason why it |
| 227 |
// needs to be kept. |
| 228 |
gnu_u1 <=> gnu_u1; // { dg-message {three-way comparison of vectors} } |
| 229 |
gnu_u1 << gnu_u1; |
| 230 |
gnu_u1 >> gnu_u1; |
| 231 |
gnu_u1 && gnu_u1; |
| 232 |
gnu_u1 || gnu_u1; |
| 233 |
|
| 234 |
// Vector-scalar binary arithmetic. |
| 235 |
|
| 236 |
sve_u1 + 2; |
| 237 |
sve_u1 - 2; |
| 238 |
sve_u1 * 2; |
| 239 |
sve_u1 / 2; |
| 240 |
sve_u1 % 2; |
| 241 |
sve_u1 & 2; |
| 242 |
sve_u1 | 2; |
| 243 |
sve_u1 ^ 2; |
| 244 |
sve_u1 == 2; |
| 245 |
sve_u1 != 2; |
| 246 |
sve_u1 <= 2; |
| 247 |
sve_u1 < 2; |
| 248 |
sve_u1 > 2; |
| 249 |
sve_u1 >= 2; |
| 250 |
sve_u1 <=> 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<=>'} } |
| 251 |
sve_u1 << 2; |
| 252 |
sve_u1 >> 2; |
| 253 |
sve_u1 && 2; |
| 254 |
sve_u1 || 2; |
| 255 |
|
| 256 |
sve_u1 + uc; |
| 257 |
sve_u1 - uc; |
| 258 |
sve_u1 * uc; |
| 259 |
sve_u1 / uc; |
| 260 |
sve_u1 % uc; |
| 261 |
sve_u1 & uc; |
| 262 |
sve_u1 | uc; |
| 263 |
sve_u1 ^ uc; |
| 264 |
sve_u1 == uc; |
| 265 |
sve_u1 != uc; |
| 266 |
sve_u1 <= uc; |
| 267 |
sve_u1 < uc; |
| 268 |
sve_u1 > uc; |
| 269 |
sve_u1 >= uc; |
| 270 |
sve_u1 <=> uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<=>'} } |
| 271 |
sve_u1 << uc; |
| 272 |
sve_u1 >> uc; |
| 273 |
sve_u1 && uc; |
| 274 |
sve_u1 || uc; |
| 275 |
|
| 276 |
gnu_u1 + 2; |
| 277 |
gnu_u1 - 2; |
| 278 |
gnu_u1 * 2; |
| 279 |
gnu_u1 / 2; |
| 280 |
gnu_u1 % 2; |
| 281 |
gnu_u1 & 2; |
| 282 |
gnu_u1 | 2; |
| 283 |
gnu_u1 ^ 2; |
| 284 |
gnu_u1 == 2; |
| 285 |
gnu_u1 != 2; |
| 286 |
gnu_u1 <= 2; |
| 287 |
gnu_u1 < 2; |
| 288 |
gnu_u1 > 2; |
| 289 |
gnu_u1 >= 2; |
| 290 |
gnu_u1 <=> 2; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'int' to binary 'operator<=>'} } |
| 291 |
gnu_u1 << 2; |
| 292 |
gnu_u1 >> 2; |
| 293 |
gnu_u1 && 2; |
| 294 |
gnu_u1 || 2; |
| 295 |
|
| 296 |
gnu_u1 + uc; |
| 297 |
gnu_u1 - uc; |
| 298 |
gnu_u1 * uc; |
| 299 |
gnu_u1 / uc; |
| 300 |
gnu_u1 % uc; |
| 301 |
gnu_u1 & uc; |
| 302 |
gnu_u1 | uc; |
| 303 |
gnu_u1 ^ uc; |
| 304 |
gnu_u1 == uc; |
| 305 |
gnu_u1 != uc; |
| 306 |
gnu_u1 <= uc; |
| 307 |
gnu_u1 < uc; |
| 308 |
gnu_u1 > uc; |
| 309 |
gnu_u1 >= uc; |
| 310 |
gnu_u1 <=> uc; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'unsigned char' to binary 'operator<=>'} } |
| 311 |
gnu_u1 << uc; |
| 312 |
gnu_u1 >> uc; |
| 313 |
gnu_u1 && uc; |
| 314 |
gnu_u1 || uc; |
| 315 |
|
| 316 |
// Scalar-vector binary 'operatorarithmetic. |
| 317 |
|
| 318 |
3 + sve_u1; |
| 319 |
3 - sve_u1; |
| 320 |
3 * sve_u1; |
| 321 |
3 / sve_u1; |
| 322 |
3 % sve_u1; |
| 323 |
3 & sve_u1; |
| 324 |
3 | sve_u1; |
| 325 |
3 ^ sve_u1; |
| 326 |
3 == sve_u1; |
| 327 |
3 != sve_u1; |
| 328 |
3 <= sve_u1; |
| 329 |
3 <=> sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<=>'} } |
| 330 |
3 < sve_u1; |
| 331 |
3 > sve_u1; |
| 332 |
3 >= sve_u1; |
| 333 |
3 << sve_u1; |
| 334 |
3 >> sve_u1; |
| 335 |
3 && sve_u1; |
| 336 |
3 || sve_u1; |
| 337 |
|
| 338 |
3 + gnu_u1; |
| 339 |
3 - gnu_u1; |
| 340 |
3 * gnu_u1; |
| 341 |
3 / gnu_u1; |
| 342 |
3 % gnu_u1; |
| 343 |
3 & gnu_u1; |
| 344 |
3 | gnu_u1; |
| 345 |
3 ^ gnu_u1; |
| 346 |
3 == gnu_u1; |
| 347 |
3 != gnu_u1; |
| 348 |
3 <= gnu_u1; |
| 349 |
3 <=> gnu_u1; // { dg-error {invalid operands of types 'int' and 'gnu_uint8_t'[^\n]* to binary 'operator<=>'} } |
| 350 |
3 < gnu_u1; |
| 351 |
3 > gnu_u1; |
| 352 |
3 >= gnu_u1; |
| 353 |
3 << gnu_u1; |
| 354 |
3 >> gnu_u1; |
| 355 |
3 && gnu_u1; |
| 356 |
3 || gnu_u1; |
| 357 |
|
| 358 |
// Mismatched types. |
| 359 |
|
| 360 |
sve_u1 + sve_s1; |
| 361 |
sve_u1 - sve_s1; |
| 362 |
sve_u1 * sve_s1; |
| 363 |
sve_u1 / sve_s1; |
| 364 |
sve_u1 % sve_s1; |
| 365 |
sve_u1 & sve_s1; |
| 366 |
sve_u1 | sve_s1; |
| 367 |
sve_u1 ^ sve_s1; |
| 368 |
sve_u1 == sve_s1; |
| 369 |
sve_u1 != sve_s1; |
| 370 |
sve_u1 <= sve_s1; |
| 371 |
sve_u1 < sve_s1; |
| 372 |
sve_u1 > sve_s1; |
| 373 |
sve_u1 >= sve_s1; |
| 374 |
sve_u1 <=> sve_s1; // { dg-message {three-way comparison of vectors} } |
| 375 |
sve_u1 << sve_s1; |
| 376 |
sve_u1 >> sve_s1; |
| 377 |
|
| 378 |
sve_u1 + gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 379 |
sve_u1 - gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 380 |
sve_u1 * gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 381 |
sve_u1 / gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 382 |
sve_u1 % gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 383 |
sve_u1 & gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 384 |
sve_u1 | gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 385 |
sve_u1 ^ gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 386 |
sve_u1 == gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 387 |
sve_u1 != gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 388 |
sve_u1 <= gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 389 |
sve_u1 < gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 390 |
sve_u1 > gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 391 |
sve_u1 >= gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 392 |
sve_u1 <=> gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 393 |
sve_u1 << gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 394 |
sve_u1 >> gnu_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 395 |
|
| 396 |
gnu_u1 + sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 397 |
gnu_u1 - sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 398 |
gnu_u1 * sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 399 |
gnu_u1 / sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 400 |
gnu_u1 % sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 401 |
gnu_u1 & sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 402 |
gnu_u1 | sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 403 |
gnu_u1 ^ sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 404 |
gnu_u1 == sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 405 |
gnu_u1 != sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 406 |
gnu_u1 <= sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 407 |
gnu_u1 < sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 408 |
gnu_u1 > sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 409 |
gnu_u1 >= sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 410 |
gnu_u1 <=> sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 411 |
gnu_u1 << sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 412 |
gnu_u1 >> sve_s1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } |
| 413 |
|
| 414 |
gnu_u1 + gnu_s1; |
| 415 |
gnu_u1 - gnu_s1; |
| 416 |
gnu_u1 * gnu_s1; |
| 417 |
gnu_u1 / gnu_s1; |
| 418 |
gnu_u1 % gnu_s1; |
| 419 |
gnu_u1 & gnu_s1; |
| 420 |
gnu_u1 | gnu_s1; |
| 421 |
gnu_u1 ^ gnu_s1; |
| 422 |
gnu_u1 == gnu_s1; |
| 423 |
gnu_u1 != gnu_s1; |
| 424 |
gnu_u1 <= gnu_s1; |
| 425 |
gnu_u1 < gnu_s1; |
| 426 |
gnu_u1 > gnu_s1; |
| 427 |
gnu_u1 >= gnu_s1; |
| 428 |
// This is a target-independent sorry. There's no ACLE reason why it |
| 429 |
// needs to be kept. |
| 430 |
gnu_u1 <=> gnu_s1; // { dg-message {three-way comparison of vectors} } |
| 431 |
gnu_u1 << gnu_s1; |
| 432 |
gnu_u1 >> gnu_s1; |
| 433 |
|
| 434 |
// Conditional expressions. |
| 435 |
|
| 436 |
uc ? sve_u1 : sve_u1; |
| 437 |
uc ? gnu_u1 : sve_u1; // { dg-error {operands to '\?:' have different types 'gnu_uint8_t'[^\n]* and 'svuint8_t'} } |
| 438 |
uc ? sve_u1 : gnu_u1; // { dg-error {operands to '\?:' have different types 'svuint8_t' and 'gnu_uint8_t'} } |
| 439 |
uc ? gnu_u1 : gnu_u1; |
| 440 |
|
| 441 |
sve_u1 ? sve_u1 : sve_u1; |
| 442 |
sve_u1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } |
| 443 |
sve_u1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } |
| 444 |
sve_u1 ? gnu_u1 : gnu_u1; |
| 445 |
sve_u1 ? sve_u1 : uc; |
| 446 |
sve_u1 ? uc : sve_u1; |
| 447 |
sve_u1 ? gnu_u1 : uc; |
| 448 |
sve_u1 ? uc : gnu_u1; |
| 449 |
|
| 450 |
gnu_u1 ? sve_u1 : sve_u1; |
| 451 |
gnu_u1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } |
| 452 |
gnu_u1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } |
| 453 |
gnu_u1 ? gnu_u1 : gnu_u1; |
| 454 |
gnu_u1 ? sve_u1 : uc; |
| 455 |
gnu_u1 ? uc : sve_u1; |
| 456 |
gnu_u1 ? gnu_u1 : uc; |
| 457 |
gnu_u1 ? uc : gnu_u1; |
| 458 |
|
| 459 |
// Vector built-ins. |
| 460 |
|
| 461 |
__builtin_shuffle (sve_u1, sve_u1, sve_u1); |
| 462 |
__builtin_shuffle (sve_u1, gnu_u1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } |
| 463 |
__builtin_shuffle (gnu_u1, sve_u1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } |
| 464 |
__builtin_shuffle (gnu_u1, gnu_u1, sve_u1); |
| 465 |
__builtin_shuffle (gnu_u1, gnu_u1, gnu_u1); |
| 466 |
|
| 467 |
__builtin_convertvector (sve_u1, svuint8_t); |
| 468 |
__builtin_convertvector (gnu_u1, svuint8_t); |
| 469 |
__builtin_convertvector (sve_u1, gnu_uint8_t); |
| 470 |
__builtin_convertvector (gnu_u1, gnu_uint8_t); |
| 471 |
|
| 472 |
// Type queries. |
| 473 |
|
| 474 |
static_assert(__is_literal_type(svuint8_t)); |
| 475 |
static_assert(__is_literal_type(gnu_uint8_t)); |
| 476 |
|
| 477 |
// Pointers. |
| 478 |
|
| 479 |
svuint8_t *sve_ptr1 = &sve_u1; |
| 480 |
svuint8_t *sve_ptr2 = &gnu_u1; // { dg-error {invalid conversion} } |
| 481 |
svuint8_t *sve_ptr3 = &sve_s1; // { dg-error {invalid conversion from 'svint8_t\*' to 'svuint8_t\*'} } |
| 482 |
svuint8_t *sve_ptr4 = &gnu_s1; // { dg-error {invalid conversion from 'gnu_int8_t\*'[^\n]* to 'svuint8_t\*'} } |
| 483 |
|
| 484 |
gnu_uint8_t *gnu_ptr1 = &sve_u1; // { dg-error {invalid conversion} } |
| 485 |
gnu_uint8_t *gnu_ptr2 = &gnu_u1; |
| 486 |
gnu_uint8_t *gnu_ptr3 = &sve_s1; // { dg-error {invalid conversion from 'svint8_t\*' to 'gnu_uint8_t\*'} } |
| 487 |
gnu_uint8_t *gnu_ptr4 = &gnu_s1; // { dg-error {invalid conversion from 'gnu_int8_t\*'[^\n]* to 'gnu_uint8_t\*'} } |
| 488 |
|
| 489 |
// References. |
| 490 |
|
| 491 |
svuint8_t &sve_ref1 = sve_u1; |
| 492 |
svuint8_t &sve_ref2 = gnu_u1; // { dg-error {cannot bind non-const lvalue reference} } |
| 493 |
svuint8_t &sve_ref3 = sve_s1; // { dg-error {cannot bind non-const lvalue reference} } |
| 494 |
svuint8_t &sve_ref4 = gnu_s1; // { dg-error {cannot bind non-const lvalue reference} } |
| 495 |
|
| 496 |
gnu_uint8_t &gnu_ref1 = sve_u1; // { dg-error {cannot bind non-const lvalue reference} } |
| 497 |
gnu_uint8_t &gnu_ref2 = gnu_u1; |
| 498 |
gnu_uint8_t &gnu_ref3 = sve_s1; // { dg-error {cannot bind non-const lvalue reference} } |
| 499 |
gnu_uint8_t &gnu_ref4 = gnu_s1; // { dg-error {cannot bind non-const lvalue reference} } |
| 500 |
} |
| 501 |
|
| 502 |
constexpr svuint8_t const1 (svuint8_t x) { return x; } |
| 503 |
constexpr gnu_uint8_t const2 (gnu_uint8_t x) { return x; } |