From: Richard Sandiford Date: Wed, 4 Dec 2019 09:18:13 +0000 (+0000) Subject: [C++] Opt out of GNU vector extensions for built-in SVE types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f1e966874de23d7e47cbaebfb5a9de6759cb089;p=gcc.git [C++] Opt out of GNU vector extensions for built-in SVE types This is the C++ equivalent of r277950. The changes are very similar to there. Perhaps the only noteworthy thing (that I know of) is that the patch continues to treat !gnu_vector_type_p vector types as literal types/potential constexprs. Disabling the GNU vector extensions shouldn't in itself stop the types from being literal types, since whatever the target provides instead might be constexpr material. 2019-12-04 Richard Sandiford gcc/cp/ * cp-tree.h (CP_AGGREGATE_TYPE_P): Check for gnu_vector_type_p instead of VECTOR_TYPE. * call.c (build_conditional_expr_1): Restrict vector handling to vectors that satisfy gnu_vector_type_p. * cvt.c (ocp_convert): Only allow vectors to be converted to bool if they satisfy gnu_vector_type_p. (build_expr_type_conversion): Only allow conversions from vectors if they satisfy gnu_vector_type_p. * typeck.c (cp_build_binary_op): Only allow binary operators to be applied to vectors if they satisfy gnu_vector_type_p. (cp_build_unary_op): Likewise unary operators. (build_reinterpret_cast_1): gcc/testsuite/ * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: New test. * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: New test. From-SVN: r278957 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 474a8506e86..fbf28741936 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +2019-12-04 Richard Sandiford + + * cp-tree.h (CP_AGGREGATE_TYPE_P): Check for gnu_vector_type_p + instead of VECTOR_TYPE. + * call.c (build_conditional_expr_1): Restrict vector handling + to vectors that satisfy gnu_vector_type_p. + * cvt.c (ocp_convert): Only allow vectors to be converted + to bool if they satisfy gnu_vector_type_p. + (build_expr_type_conversion): Only allow conversions from + vectors if they satisfy gnu_vector_type_p. + * typeck.c (cp_build_binary_op): Only allow binary operators to be + applied to vectors if they satisfy gnu_vector_type_p. + (cp_build_unary_op): Likewise unary operators. + (build_reinterpret_cast_1): + 2019-12-03 Jakub Jelinek * cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index ea0e8b7e7d7..5e9523e97b5 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5093,7 +5093,8 @@ build_conditional_expr_1 (const op_location_t &loc, orig_arg2 = arg2; orig_arg3 = arg3; - if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1))) + if (gnu_vector_type_p (TREE_TYPE (arg1)) + && VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1))) { tree arg1_type = TREE_TYPE (arg1); @@ -5172,7 +5173,8 @@ build_conditional_expr_1 (const op_location_t &loc, arg3_type = vtype; } - if (VECTOR_TYPE_P (arg2_type) != VECTOR_TYPE_P (arg3_type)) + if ((gnu_vector_type_p (arg2_type) && !VECTOR_TYPE_P (arg3_type)) + || (gnu_vector_type_p (arg3_type) && !VECTOR_TYPE_P (arg2_type))) { enum stv_conv convert_flag = scalar_to_vector (loc, VEC_COND_EXPR, arg2, arg3, @@ -5203,7 +5205,9 @@ build_conditional_expr_1 (const op_location_t &loc, } } - if (!same_type_p (arg2_type, arg3_type) + if (!gnu_vector_type_p (arg2_type) + || !gnu_vector_type_p (arg3_type) + || !same_type_p (arg2_type, arg3_type) || maybe_ne (TYPE_VECTOR_SUBPARTS (arg1_type), TYPE_VECTOR_SUBPARTS (arg2_type)) || TYPE_SIZE (arg1_type) != TYPE_SIZE (arg2_type)) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 666894ff882..89828d904d5 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4254,7 +4254,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) As an extension, we also treat vectors as aggregates. Keep these checks in ascending code order. */ #define CP_AGGREGATE_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == VECTOR_TYPE \ + (gnu_vector_type_p (TYPE) \ || TREE_CODE (TYPE) == ARRAY_TYPE \ || (CLASS_TYPE_P (TYPE) && COMPLETE_TYPE_P (TYPE) && !CLASSTYPE_NON_AGGREGATE (TYPE))) diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index d916e39ee90..cde3760886a 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -836,6 +836,14 @@ ocp_convert (tree type, tree expr, int convtype, int flags, return error_mark_node; } + if (VECTOR_TYPE_P (intype) && !gnu_vector_type_p (intype)) + { + if (complain & tf_error) + error_at (loc, "could not convert %qE from %qH to %qI", expr, + TREE_TYPE (expr), type); + return error_mark_node; + } + /* We can't implicitly convert a scoped enum to bool, so convert to the underlying type first. */ if (SCOPED_ENUM_P (intype) && (convtype & CONV_STATIC)) @@ -1763,8 +1771,11 @@ build_expr_type_conversion (int desires, tree expr, bool complain) tf_warning_or_error) : NULL_TREE; - case COMPLEX_TYPE: case VECTOR_TYPE: + if (!gnu_vector_type_p (basetype)) + return NULL_TREE; + /* FALLTHROUGH */ + case COMPLEX_TYPE: if ((desires & WANT_VECTOR_OR_COMPLEX) == 0) return NULL_TREE; switch (TREE_CODE (TREE_TYPE (basetype))) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3b947c32bbc..5976b6c7bbc 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4547,7 +4547,8 @@ cp_build_binary_op (const op_location_t &location, /* In case when one of the operands of the binary operation is a vector and another is a scalar -- convert scalar to vector. */ - if ((code0 == VECTOR_TYPE) != (code1 == VECTOR_TYPE)) + if ((gnu_vector_type_p (type0) && code1 != VECTOR_TYPE) + || (gnu_vector_type_p (type1) && code0 != VECTOR_TYPE)) { enum stv_conv convert_flag = scalar_to_vector (location, code, op0, op1, complain & tf_error); @@ -4740,7 +4741,7 @@ cp_build_binary_op (const op_location_t &location, case TRUTH_ORIF_EXPR: case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: - if (!VECTOR_TYPE_P (type0) && VECTOR_TYPE_P (type1)) + if (!VECTOR_TYPE_P (type0) && gnu_vector_type_p (type1)) { if (!COMPARISON_CLASS_P (op1)) op1 = cp_build_binary_op (EXPR_LOCATION (op1), NE_EXPR, op1, @@ -4758,7 +4759,8 @@ cp_build_binary_op (const op_location_t &location, else gcc_unreachable (); } - if (VECTOR_TYPE_P (type0)) + if (gnu_vector_type_p (type0) + && (!VECTOR_TYPE_P (type1) || gnu_vector_type_p (type1))) { if (!COMPARISON_CLASS_P (op0)) op0 = cp_build_binary_op (EXPR_LOCATION (op0), NE_EXPR, op0, @@ -4791,13 +4793,15 @@ cp_build_binary_op (const op_location_t &location, Also set SHORT_SHIFT if shifting rightward. */ case RSHIFT_EXPR: - if (code0 == VECTOR_TYPE && code1 == INTEGER_TYPE - && TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE) + if (gnu_vector_type_p (type0) + && code1 == INTEGER_TYPE + && TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE) { result_type = type0; converted = 1; } - else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE + else if (gnu_vector_type_p (type0) + && gnu_vector_type_p (type1) && TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE && TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE && known_eq (TYPE_VECTOR_SUBPARTS (type0), @@ -4837,13 +4841,15 @@ cp_build_binary_op (const op_location_t &location, break; case LSHIFT_EXPR: - if (code0 == VECTOR_TYPE && code1 == INTEGER_TYPE + if (gnu_vector_type_p (type0) + && code1 == INTEGER_TYPE && TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE) { result_type = type0; converted = 1; } - else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE + else if (gnu_vector_type_p (type0) + && gnu_vector_type_p (type1) && TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE && TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE && known_eq (TYPE_VECTOR_SUBPARTS (type0), @@ -4896,7 +4902,7 @@ cp_build_binary_op (const op_location_t &location, case EQ_EXPR: case NE_EXPR: - if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) + if (gnu_vector_type_p (type0) && gnu_vector_type_p (type1)) goto vector_compare; if ((complain & tf_warning) && c_inhibit_evaluation_warnings == 0 @@ -5186,7 +5192,7 @@ cp_build_binary_op (const op_location_t &location, "in unspecified behavior"); } - if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) + if (gnu_vector_type_p (type0) && gnu_vector_type_p (type1)) { vector_compare: tree intt; @@ -5341,7 +5347,7 @@ cp_build_binary_op (const op_location_t &location, { arithmetic_types_p = 0; /* Vector arithmetic is only allowed when both sides are vectors. */ - if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) + if (gnu_vector_type_p (type0) && gnu_vector_type_p (type1)) { if (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1)) || !vector_types_compatible_elements_p (type0, type1)) @@ -6435,7 +6441,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, break; case TRUTH_NOT_EXPR: - if (VECTOR_TYPE_P (TREE_TYPE (arg))) + if (gnu_vector_type_p (TREE_TYPE (arg))) return cp_build_binary_op (input_location, EQ_EXPR, arg, build_zero_cst (TREE_TYPE (arg)), complain); arg = perform_implicit_conversion (boolean_type_node, arg, @@ -7811,9 +7817,9 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, "is conditionally-supported"); return build_nop_reinterpret (type, expr); } - else if (VECTOR_TYPE_P (type)) + else if (gnu_vector_type_p (type)) return convert_to_vector (type, expr); - else if (VECTOR_TYPE_P (intype) + else if (gnu_vector_type_p (intype) && INTEGRAL_OR_ENUMERATION_TYPE_P (type)) return convert_to_integer_nofold (type, expr); else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f3edaf5dcd..3dbf60162f5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-12-04 Richard Sandiford + + * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: New test. + * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: New test. + 2019-12-04 Jakub Jelinek PR fortran/92756 diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C new file mode 100644 index 00000000000..d1da64c901b --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C @@ -0,0 +1,489 @@ +// { dg-options "-msve-vector-bits=256 -std=gnu++2a" } + +#include + +typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); +typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); + +void +f (svuint8_t sve_u1, svint8_t sve_s1, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +{ + // Initialization + + svuint8_t init_sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u2 = {}; + svuint8_t init_sve_u3 = { sve_u1 }; + svuint8_t init_sve_u4 = { gnu_u1 }; + svuint8_t init_sve_u5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svuint8_t' in initialization} } + svuint8_t init_sve_u7 = { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u8 = { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u9 = { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u10 {}; + svuint8_t init_sve_u11 { sve_u1 }; + svuint8_t init_sve_u12 { gnu_u1 }; + svuint8_t init_sve_u13 { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u14 { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svuint8_t' in initialization} } + svuint8_t init_sve_u15 { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u16 { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u17 { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u18 (0); // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u19 (sve_u1); + svuint8_t init_sve_u20 (gnu_u1); + svuint8_t init_sve_u21 (sve_s1); // { dg-error {cannot convert 'svint8_t' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u22 (gnu_s1); // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svuint8_t' in initialization} } + + gnu_uint8_t init_gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } + gnu_uint8_t init_gnu_u2 = {}; + gnu_uint8_t init_gnu_u3 = { sve_u1 }; + gnu_uint8_t init_gnu_u4 = { gnu_u1 }; + gnu_uint8_t init_gnu_u5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u7 = { 0 }; + gnu_uint8_t init_gnu_u8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u10 { sve_u1 }; + gnu_uint8_t init_gnu_u11 { gnu_u1 }; + gnu_uint8_t init_gnu_u12 { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u13 { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u14 { 0 }; + gnu_uint8_t init_gnu_u15 { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u16 { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u17 (0); // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } + gnu_uint8_t init_gnu_u18 (sve_u1); + gnu_uint8_t init_gnu_u19 (gnu_u1); + gnu_uint8_t init_gnu_u20 (sve_s1); // { dg-error {cannot convert 'svint8_t' to 'gnu_uint8_t'[^\n]* in initialization} } + gnu_uint8_t init_gnu_u21 (gnu_s1); // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'gnu_uint8_t'[^\n]* in initialization} } + + // Compound literals + + (svuint8_t) {}; + (svuint8_t) { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + (svuint8_t) { sve_u1 }; + (svuint8_t) { gnu_u1 }; + (svuint8_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'svuint8_t' in initialization} } + (svuint8_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svuint8_t' in initialization} } + (svuint8_t) { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + (svuint8_t) { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + + (gnu_uint8_t) {}; + (gnu_uint8_t) { 0 }; + (gnu_uint8_t) { sve_u1 }; + (gnu_uint8_t) { gnu_u1 }; + (gnu_uint8_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + (gnu_uint8_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + (gnu_uint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + (gnu_uint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + + // Assignment + + sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in assignment} } + sve_u1 = sve_u1; + sve_u1 = gnu_u1; + sve_u1 = sve_s1; // { dg-error {cannot convert 'svint8_t' to 'svuint8_t' in assignment} } + sve_u1 = gnu_s1; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svuint8_t' in assignment} } + + gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in assignment} } + gnu_u1 = sve_u1; + gnu_u1 = gnu_u1; + gnu_u1 = sve_s1; // { dg-error {cannot convert 'svint8_t' to 'gnu_uint8_t'[^\n]* in assignment} } + gnu_u1 = gnu_s1; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'gnu_uint8_t'[^\n]* in assignment} } + + // Casts + + (void) sve_u1; + (int) sve_u1; // { dg-error {invalid cast from type 'svuint8_t' to type 'int'} } + (bool) sve_u1; // { dg-error {invalid cast from type 'svuint8_t' to type 'bool'} } + (svuint8_t) 0; // { dg-error {invalid cast from type 'int' to type 'svuint8_t'} } + (svuint8_t) n; // { dg-error {invalid cast from type 'int' to type 'svuint8_t'} } + (svuint8_t) sve_u1; + (svuint8_t) gnu_u1; + (svuint8_t) sve_s1; // { dg-error {invalid cast from type 'svint8_t' to type 'svuint8_t'} } + (svuint8_t) gnu_s1; // { dg-error {invalid cast from type 'gnu_int8_t'[^\n]* to type 'svuint8_t'} } + + (void) gnu_u1; + (int) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'int'} } + (bool) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'bool'} } + (gnu_uint8_t) 0; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } + (gnu_uint8_t) n; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } + (gnu_uint8_t) sve_u1; + (gnu_uint8_t) gnu_u1; + (gnu_uint8_t) sve_s1; + (gnu_uint8_t) gnu_s1; + + // Vector indexing. + + sve_u1[0]; // { dg-error {subscripted value is neither array nor pointer} } + &sve_u1[0]; // { dg-error {subscripted value is neither array nor pointer} } + + gnu_u1[0]; + &gnu_u1[0]; + + // Unary vector arithmetic. + + +sve_u1; // { dg-error {wrong type argument to unary plus} } + -sve_u1; // { dg-error {wrong type argument to unary minus} } + ~sve_u1; // { dg-error {wrong type argument to bit-complement} } + !sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + // { dg-error {in argument to unary !} "" { target *-*-* } .-1 } + *sve_u1; // { dg-error {invalid type argument of unary '\*'} } + __real sve_u1; // { dg-error {wrong type argument to __real} } + __imag sve_u1; // { dg-error {wrong type argument to __imag} } + ++sve_u1; // { dg-error {no pre-increment operator for type} } + --sve_u1; // { dg-error {no pre-decrement operator for type} } + sve_u1++; // { dg-error {no post-increment operator for type} } + sve_u1--; // { dg-error {no post-decrement operator for type} } + + +gnu_u1; + -gnu_u1; + ~gnu_u1; + !gnu_u1; + *gnu_u1; // { dg-error {invalid type argument of unary '\*'} } + __real gnu_u1; // { dg-error {wrong type argument to __real} } + __imag gnu_u1; // { dg-error {wrong type argument to __imag} } + ++gnu_u1; + --gnu_u1; + gnu_u1++; + gnu_u1--; + + // Vector-vector binary arithmetic. + + sve_u1 + sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\+'} } + sve_u1 - sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator-'} } + sve_u1 * sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\*'} } + sve_u1 / sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator/'} } + sve_u1 % sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator%'} } + sve_u1 & sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\&'} } + sve_u1 | sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\|'} } + sve_u1 ^ sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\^'} } + sve_u1 == sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator=='} } + sve_u1 != sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator!='} } + sve_u1 <= sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<='} } + sve_u1 < sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<'} } + sve_u1 > sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>'} } + sve_u1 >= sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>='} } + sve_u1 <=> sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<=>'} } + sve_u1 << sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<<'} } + sve_u1 >> sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>>'} } + sve_u1 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + sve_u1 + gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\+'} } + sve_u1 - gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator-'} } + sve_u1 * gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\*'} } + sve_u1 / gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator/'} } + sve_u1 % gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator%'} } + sve_u1 & gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\&'} } + sve_u1 | gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\|'} } + sve_u1 ^ gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\^'} } + sve_u1 == gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator=='} } + sve_u1 != gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator!='} } + sve_u1 <= gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<='} } + sve_u1 < gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<'} } + sve_u1 > gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>'} } + sve_u1 >= gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>='} } + sve_u1 <=> gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<=>'} } + sve_u1 << gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<<'} } + sve_u1 >> gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>>'} } + sve_u1 && gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\+'} } + gnu_u1 - sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator-'} } + gnu_u1 * sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\*'} } + gnu_u1 / sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator/'} } + gnu_u1 % sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator%'} } + gnu_u1 & sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\&'} } + gnu_u1 | sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\|'} } + gnu_u1 ^ sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\^'} } + gnu_u1 == sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator=='} } + gnu_u1 != sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator!='} } + gnu_u1 <= sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<='} } + gnu_u1 < sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<'} } + gnu_u1 > sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>'} } + gnu_u1 >= sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>='} } + gnu_u1 <=> sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<=>'} } + gnu_u1 << sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<<'} } + gnu_u1 >> sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>>'} } + gnu_u1 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + gnu_u1 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + gnu_u1; + gnu_u1 - gnu_u1; + gnu_u1 * gnu_u1; + gnu_u1 / gnu_u1; + gnu_u1 % gnu_u1; + gnu_u1 & gnu_u1; + gnu_u1 | gnu_u1; + gnu_u1 ^ gnu_u1; + gnu_u1 == gnu_u1; + gnu_u1 != gnu_u1; + gnu_u1 <= gnu_u1; + gnu_u1 < gnu_u1; + gnu_u1 > gnu_u1; + gnu_u1 >= gnu_u1; + // This is a target-independent sorry. There's no ACLE reason why it + // needs to be kept. + gnu_u1 <=> gnu_u1; // { dg-message {three-way comparison of vectors} } + gnu_u1 << gnu_u1; + gnu_u1 >> gnu_u1; + gnu_u1 && gnu_u1; + gnu_u1 || gnu_u1; + + // Vector-scalar binary arithmetic. + + sve_u1 + 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\+'} } + sve_u1 - 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator-'} } + sve_u1 * 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\*'} } + sve_u1 / 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator/'} } + sve_u1 % 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator%'} } + sve_u1 & 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\&'} } + sve_u1 | 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\|'} } + sve_u1 ^ 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\^'} } + sve_u1 == 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator=='} } + sve_u1 != 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator!='} } + sve_u1 <= 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<='} } + sve_u1 < 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<'} } + sve_u1 > 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>'} } + sve_u1 >= 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>='} } + sve_u1 <=> 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<=>'} } + sve_u1 << 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<<'} } + sve_u1 >> 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>>'} } + sve_u1 && 2; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || 2; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + sve_u1 + uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\+'} } + sve_u1 - uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator-'} } + sve_u1 * uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\*'} } + sve_u1 / uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator/'} } + sve_u1 % uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator%'} } + sve_u1 & uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\&'} } + sve_u1 | uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\|'} } + sve_u1 ^ uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\^'} } + sve_u1 == uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator=='} } + sve_u1 != uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator!='} } + sve_u1 <= uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<='} } + sve_u1 < uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<'} } + sve_u1 > uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>'} } + sve_u1 >= uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>='} } + sve_u1 <=> uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<=>'} } + sve_u1 << uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<<'} } + sve_u1 >> uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>>'} } + sve_u1 && uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + 2; + gnu_u1 - 2; + gnu_u1 * 2; + gnu_u1 / 2; + gnu_u1 % 2; + gnu_u1 & 2; + gnu_u1 | 2; + gnu_u1 ^ 2; + gnu_u1 == 2; + gnu_u1 != 2; + gnu_u1 <= 2; + gnu_u1 < 2; + gnu_u1 > 2; + gnu_u1 >= 2; + gnu_u1 <=> 2; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'int' to binary 'operator<=>'} } + gnu_u1 << 2; + gnu_u1 >> 2; + gnu_u1 && 2; + gnu_u1 || 2; + + gnu_u1 + uc; + gnu_u1 - uc; + gnu_u1 * uc; + gnu_u1 / uc; + gnu_u1 % uc; + gnu_u1 & uc; + gnu_u1 | uc; + gnu_u1 ^ uc; + gnu_u1 == uc; + gnu_u1 != uc; + gnu_u1 <= uc; + gnu_u1 < uc; + gnu_u1 > uc; + gnu_u1 >= uc; + gnu_u1 <=> uc; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'unsigned char' to binary 'operator<=>'} } + gnu_u1 << uc; + gnu_u1 >> uc; + gnu_u1 && uc; + gnu_u1 || uc; + + // Scalar-vector binary 'operatorarithmetic. + + 3 + sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\+'} } + 3 - sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator-'} } + 3 * sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\*'} } + 3 / sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator/'} } + 3 % sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator%'} } + 3 & sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\&'} } + 3 | sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\|'} } + 3 ^ sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\^'} } + 3 == sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator=='} } + 3 != sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator!='} } + 3 <= sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<='} } + 3 <=> sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<=>'} } + 3 < sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<'} } + 3 > sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>'} } + 3 >= sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>='} } + 3 << sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<<'} } + 3 >> sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>>'} } + 3 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + 3 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + 3 + gnu_u1; + 3 - gnu_u1; + 3 * gnu_u1; + 3 / gnu_u1; + 3 % gnu_u1; + 3 & gnu_u1; + 3 | gnu_u1; + 3 ^ gnu_u1; + 3 == gnu_u1; + 3 != gnu_u1; + 3 <= gnu_u1; + 3 <=> gnu_u1; // { dg-error {invalid operands of types 'int' and 'gnu_uint8_t'[^\n]* to binary 'operator<=>'} } + 3 < gnu_u1; + 3 > gnu_u1; + 3 >= gnu_u1; + 3 << gnu_u1; + 3 >> gnu_u1; + 3 && gnu_u1; + 3 || gnu_u1; + + // Mismatched types. + + sve_u1 + sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\+'} } + sve_u1 - sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator-'} } + sve_u1 * sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\*'} } + sve_u1 / sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator/'} } + sve_u1 % sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator%'} } + sve_u1 & sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\&'} } + sve_u1 | sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\|'} } + sve_u1 ^ sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\^'} } + sve_u1 == sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator=='} } + sve_u1 != sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator!='} } + sve_u1 <= sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<='} } + sve_u1 < sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<'} } + sve_u1 > sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>'} } + sve_u1 >= sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>='} } + sve_u1 <=> sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<=>'} } + sve_u1 << sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<<'} } + sve_u1 >> sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>>'} } + + sve_u1 + gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\+'} } + sve_u1 - gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator-'} } + sve_u1 * gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\*'} } + sve_u1 / gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator/'} } + sve_u1 % gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator%'} } + sve_u1 & gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\&'} } + sve_u1 | gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\|'} } + sve_u1 ^ gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\^'} } + sve_u1 == gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator=='} } + sve_u1 != gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator!='} } + sve_u1 <= gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<='} } + sve_u1 < gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<'} } + sve_u1 > gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>'} } + sve_u1 >= gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>='} } + sve_u1 <=> gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<=>'} } + sve_u1 << gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<<'} } + sve_u1 >> gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>>'} } + + gnu_u1 + sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\+'} } + gnu_u1 - sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator-'} } + gnu_u1 * sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\*'} } + gnu_u1 / sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator/'} } + gnu_u1 % sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator%'} } + gnu_u1 & sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\&'} } + gnu_u1 | sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\|'} } + gnu_u1 ^ sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\^'} } + gnu_u1 == sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator=='} } + gnu_u1 != sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator!='} } + gnu_u1 <= sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<='} } + gnu_u1 < sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<'} } + gnu_u1 > sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>'} } + gnu_u1 >= sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>='} } + gnu_u1 <=> sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<=>'} } + gnu_u1 << sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<<'} } + gnu_u1 >> sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>>'} } + + gnu_u1 + gnu_s1; + gnu_u1 - gnu_s1; + gnu_u1 * gnu_s1; + gnu_u1 / gnu_s1; + gnu_u1 % gnu_s1; + gnu_u1 & gnu_s1; + gnu_u1 | gnu_s1; + gnu_u1 ^ gnu_s1; + gnu_u1 == gnu_s1; + gnu_u1 != gnu_s1; + gnu_u1 <= gnu_s1; + gnu_u1 < gnu_s1; + gnu_u1 > gnu_s1; + gnu_u1 >= gnu_s1; + // This is a target-independent sorry. There's no ACLE reason why it + // needs to be kept. + gnu_u1 <=> gnu_s1; // { dg-message {three-way comparison of vectors} } + gnu_u1 << gnu_s1; + gnu_u1 >> gnu_s1; + + // Conditional expressions. + + uc ? sve_u1 : sve_u1; + uc ? gnu_u1 : sve_u1; // { dg-error {operands to '\?:' have different types 'gnu_uint8_t'[^\n]* and 'svuint8_t'} "" { xfail *-*-* } } + uc ? sve_u1 : gnu_u1; // { dg-error {operands to '\?:' have different types 'svuint8_t' and 'gnu_uint8_t'} "" { xfail *-*-* } } + uc ? gnu_u1 : gnu_u1; + + sve_u1 ? sve_u1 : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? sve_u1 : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? sve_u1 : uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? uc : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? uc : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 ? sve_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : gnu_u1; + gnu_u1 ? sve_u1 : uc; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? uc : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : uc; + gnu_u1 ? uc : gnu_u1; + + // Vector built-ins. + + __builtin_shuffle (sve_u1, sve_u1, sve_u1); // { dg-error {'__builtin_shuffle' last argument must be an integer vector} } + __builtin_shuffle (sve_u1, gnu_u1, gnu_u1); // { dg-error {'__builtin_shuffle' arguments must be vectors} } + __builtin_shuffle (gnu_u1, sve_u1, gnu_u1); // { dg-error {'__builtin_shuffle' arguments must be vectors} } + __builtin_shuffle (gnu_u1, gnu_u1, sve_u1); // { dg-error {'__builtin_shuffle' last argument must be an integer vector} } + __builtin_shuffle (gnu_u1, gnu_u1, gnu_u1); + + __builtin_convertvector (sve_u1, svuint8_t); // { dg-error {'__builtin_convertvector' first argument must be an integer or floating vector} } + __builtin_convertvector (gnu_u1, svuint8_t); // { dg-error {'__builtin_convertvector' second argument must be an integer or floating vector type} } + __builtin_convertvector (sve_u1, gnu_uint8_t); // { dg-error {'__builtin_convertvector' first argument must be an integer or floating vector} } + __builtin_convertvector (gnu_u1, gnu_uint8_t); + + // Type queries. + + static_assert(__is_literal_type(svuint8_t)); + static_assert(__is_literal_type(gnu_uint8_t)); + + svuint8_t *sve_ptr1 = &sve_u1; + svuint8_t *sve_ptr2 = &gnu_u1; + svuint8_t *sve_ptr3 = &sve_s1; // { dg-error {cannot convert 'svint8_t\*' to 'svuint8_t\*' in initialization} } + svuint8_t *sve_ptr4 = &gnu_s1; // { dg-error {cannot convert 'gnu_int8_t\*'[^\n]* to 'svuint8_t\*' in initialization} } + + gnu_uint8_t *gnu_ptr1 = &sve_u1; + gnu_uint8_t *gnu_ptr2 = &gnu_u1; + gnu_uint8_t *gnu_ptr3 = &sve_s1; // { dg-error {cannot convert 'svint8_t\*' to 'gnu_uint8_t\*'} } + gnu_uint8_t *gnu_ptr4 = &gnu_s1; // { dg-error {cannot convert 'gnu_int8_t\*'[^\n]* to 'gnu_uint8_t\*'} } +} + +constexpr svuint8_t const1 (svuint8_t x) { return x; } +constexpr gnu_uint8_t const2 (gnu_uint8_t x) { return x; } diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C new file mode 100644 index 00000000000..da4462b2421 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C @@ -0,0 +1,489 @@ +// { dg-options "-msve-vector-bits=256 -std=gnu++2a -flax-vector-conversions" } + +#include + +typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); +typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); + +void +f (svuint8_t sve_u1, svint8_t sve_s1, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +{ + // Initialization + + svuint8_t init_sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u2 = {}; + svuint8_t init_sve_u3 = { sve_u1 }; + svuint8_t init_sve_u4 = { gnu_u1 }; + svuint8_t init_sve_u5 = { sve_s1 }; + svuint8_t init_sve_u6 = { gnu_s1 }; + svuint8_t init_sve_u7 = { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u8 = { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u9 = { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u10 {}; + svuint8_t init_sve_u11 { sve_u1 }; + svuint8_t init_sve_u12 { gnu_u1 }; + svuint8_t init_sve_u13 { sve_s1 }; + svuint8_t init_sve_u14 { gnu_s1 }; + svuint8_t init_sve_u15 { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u16 { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u17 { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + svuint8_t init_sve_u18 (0); // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + svuint8_t init_sve_u19 (sve_u1); + svuint8_t init_sve_u20 (gnu_u1); + svuint8_t init_sve_u21 (sve_s1); + svuint8_t init_sve_u22 (gnu_s1); + + gnu_uint8_t init_gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } + gnu_uint8_t init_gnu_u2 = {}; + gnu_uint8_t init_gnu_u3 = { sve_u1 }; + gnu_uint8_t init_gnu_u4 = { gnu_u1 }; + gnu_uint8_t init_gnu_u5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u7 = { 0 }; + gnu_uint8_t init_gnu_u8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u10 { sve_u1 }; + gnu_uint8_t init_gnu_u11 { gnu_u1 }; + gnu_uint8_t init_gnu_u12 { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u13 { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u14 { 0 }; + gnu_uint8_t init_gnu_u15 { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u16 { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + gnu_uint8_t init_gnu_u17 (0); // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in initialization} } + gnu_uint8_t init_gnu_u18 (sve_u1); + gnu_uint8_t init_gnu_u19 (gnu_u1); + gnu_uint8_t init_gnu_u20 (sve_s1); + gnu_uint8_t init_gnu_u21 (gnu_s1); + + // Compound literals + + (svuint8_t) {}; + (svuint8_t) { 0 }; // { dg-error {cannot convert 'int' to 'svuint8_t' in initialization} } + (svuint8_t) { sve_u1 }; + (svuint8_t) { gnu_u1 }; + (svuint8_t) { sve_s1 }; + (svuint8_t) { gnu_s1 }; + (svuint8_t) { sve_u1, sve_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + (svuint8_t) { gnu_u1, gnu_u1 }; // { dg-error {too many initializers for 'svuint8_t'} } + + (gnu_uint8_t) {}; + (gnu_uint8_t) { 0 }; + (gnu_uint8_t) { sve_u1 }; + (gnu_uint8_t) { gnu_u1 }; + (gnu_uint8_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'unsigned char' in initialization} } + (gnu_uint8_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'unsigned char' in initialization} } + (gnu_uint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } + (gnu_uint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + + // Assignment + + sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in assignment} } + sve_u1 = sve_u1; + sve_u1 = gnu_u1; + sve_u1 = sve_s1; + sve_u1 = gnu_s1; + + gnu_u1 = 0; // { dg-error {cannot convert 'int' to 'gnu_uint8_t'[^\n]* in assignment} } + gnu_u1 = sve_u1; + gnu_u1 = gnu_u1; + gnu_u1 = sve_s1; + gnu_u1 = gnu_s1; + + // Casts + + (void) sve_u1; + (int) sve_u1; // { dg-error {invalid cast from type 'svuint8_t' to type 'int'} } + (bool) sve_u1; // { dg-error {invalid cast from type 'svuint8_t' to type 'bool'} } + (svuint8_t) 0; // { dg-error {invalid cast from type 'int' to type 'svuint8_t'} } + (svuint8_t) n; // { dg-error {invalid cast from type 'int' to type 'svuint8_t'} } + (svuint8_t) sve_u1; + (svuint8_t) gnu_u1; + (svuint8_t) sve_s1; + (svuint8_t) gnu_s1; + + (void) gnu_u1; + (int) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'int'} } + (bool) gnu_u1; // { dg-error {cannot convert a vector of type 'gnu_uint8_t'[^\n]* to type 'bool'} } + (gnu_uint8_t) 0; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } + (gnu_uint8_t) n; // { dg-error {cannot convert a value of type 'int' to vector type 'gnu_uint8_t'} } + (gnu_uint8_t) sve_u1; + (gnu_uint8_t) gnu_u1; + (gnu_uint8_t) sve_s1; + (gnu_uint8_t) gnu_s1; + + // Vector indexing. + + sve_u1[0]; // { dg-error {subscripted value is neither array nor pointer} } + &sve_u1[0]; // { dg-error {subscripted value is neither array nor pointer} } + + gnu_u1[0]; + &gnu_u1[0]; + + // Unary vector arithmetic. + + +sve_u1; // { dg-error {wrong type argument to unary plus} } + -sve_u1; // { dg-error {wrong type argument to unary minus} } + ~sve_u1; // { dg-error {wrong type argument to bit-complement} } + !sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + // { dg-error {in argument to unary !} "" { target *-*-* } .-1 } + *sve_u1; // { dg-error {invalid type argument of unary '\*'} } + __real sve_u1; // { dg-error {wrong type argument to __real} } + __imag sve_u1; // { dg-error {wrong type argument to __imag} } + ++sve_u1; // { dg-error {no pre-increment operator for type} } + --sve_u1; // { dg-error {no pre-decrement operator for type} } + sve_u1++; // { dg-error {no post-increment operator for type} } + sve_u1--; // { dg-error {no post-decrement operator for type} } + + +gnu_u1; + -gnu_u1; + ~gnu_u1; + !gnu_u1; + *gnu_u1; // { dg-error {invalid type argument of unary '\*'} } + __real gnu_u1; // { dg-error {wrong type argument to __real} } + __imag gnu_u1; // { dg-error {wrong type argument to __imag} } + ++gnu_u1; + --gnu_u1; + gnu_u1++; + gnu_u1--; + + // Vector-vector binary arithmetic. + + sve_u1 + sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\+'} } + sve_u1 - sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator-'} } + sve_u1 * sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\*'} } + sve_u1 / sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator/'} } + sve_u1 % sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator%'} } + sve_u1 & sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\&'} } + sve_u1 | sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\|'} } + sve_u1 ^ sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator\^'} } + sve_u1 == sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator=='} } + sve_u1 != sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator!='} } + sve_u1 <= sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<='} } + sve_u1 < sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<'} } + sve_u1 > sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>'} } + sve_u1 >= sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>='} } + sve_u1 <=> sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<=>'} } + sve_u1 << sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator<<'} } + sve_u1 >> sve_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'svuint8_t' to binary 'operator>>'} } + sve_u1 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + sve_u1 + gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\+'} } + sve_u1 - gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator-'} } + sve_u1 * gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\*'} } + sve_u1 / gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator/'} } + sve_u1 % gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator%'} } + sve_u1 & gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\&'} } + sve_u1 | gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\|'} } + sve_u1 ^ gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator\^'} } + sve_u1 == gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator=='} } + sve_u1 != gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator!='} } + sve_u1 <= gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<='} } + sve_u1 < gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<'} } + sve_u1 > gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>'} } + sve_u1 >= gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>='} } + sve_u1 <=> gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<=>'} } + sve_u1 << gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator<<'} } + sve_u1 >> gnu_u1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_uint8_t'[^\n]* to binary 'operator>>'} } + sve_u1 && gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\+'} } + gnu_u1 - sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator-'} } + gnu_u1 * sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\*'} } + gnu_u1 / sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator/'} } + gnu_u1 % sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator%'} } + gnu_u1 & sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\&'} } + gnu_u1 | sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\|'} } + gnu_u1 ^ sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator\^'} } + gnu_u1 == sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator=='} } + gnu_u1 != sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator!='} } + gnu_u1 <= sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<='} } + gnu_u1 < sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<'} } + gnu_u1 > sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>'} } + gnu_u1 >= sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>='} } + gnu_u1 <=> sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<=>'} } + gnu_u1 << sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator<<'} } + gnu_u1 >> sve_u1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svuint8_t' to binary 'operator>>'} } + gnu_u1 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + gnu_u1 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + gnu_u1; + gnu_u1 - gnu_u1; + gnu_u1 * gnu_u1; + gnu_u1 / gnu_u1; + gnu_u1 % gnu_u1; + gnu_u1 & gnu_u1; + gnu_u1 | gnu_u1; + gnu_u1 ^ gnu_u1; + gnu_u1 == gnu_u1; + gnu_u1 != gnu_u1; + gnu_u1 <= gnu_u1; + gnu_u1 < gnu_u1; + gnu_u1 > gnu_u1; + gnu_u1 >= gnu_u1; + // This is a target-independent sorry. There's no ACLE reason why it + // needs to be kept. + gnu_u1 <=> gnu_u1; // { dg-message {three-way comparison of vectors} } + gnu_u1 << gnu_u1; + gnu_u1 >> gnu_u1; + gnu_u1 && gnu_u1; + gnu_u1 || gnu_u1; + + // Vector-scalar binary arithmetic. + + sve_u1 + 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\+'} } + sve_u1 - 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator-'} } + sve_u1 * 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\*'} } + sve_u1 / 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator/'} } + sve_u1 % 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator%'} } + sve_u1 & 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\&'} } + sve_u1 | 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\|'} } + sve_u1 ^ 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator\^'} } + sve_u1 == 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator=='} } + sve_u1 != 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator!='} } + sve_u1 <= 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<='} } + sve_u1 < 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<'} } + sve_u1 > 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>'} } + sve_u1 >= 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>='} } + sve_u1 <=> 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<=>'} } + sve_u1 << 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator<<'} } + sve_u1 >> 2; // { dg-error {invalid operands of types 'svuint8_t' and 'int' to binary 'operator>>'} } + sve_u1 && 2; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || 2; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + sve_u1 + uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\+'} } + sve_u1 - uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator-'} } + sve_u1 * uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\*'} } + sve_u1 / uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator/'} } + sve_u1 % uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator%'} } + sve_u1 & uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\&'} } + sve_u1 | uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\|'} } + sve_u1 ^ uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator\^'} } + sve_u1 == uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator=='} } + sve_u1 != uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator!='} } + sve_u1 <= uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<='} } + sve_u1 < uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<'} } + sve_u1 > uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>'} } + sve_u1 >= uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>='} } + sve_u1 <=> uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<=>'} } + sve_u1 << uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator<<'} } + sve_u1 >> uc; // { dg-error {invalid operands of types 'svuint8_t' and 'unsigned char' to binary 'operator>>'} } + sve_u1 && uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 || uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 + 2; + gnu_u1 - 2; + gnu_u1 * 2; + gnu_u1 / 2; + gnu_u1 % 2; + gnu_u1 & 2; + gnu_u1 | 2; + gnu_u1 ^ 2; + gnu_u1 == 2; + gnu_u1 != 2; + gnu_u1 <= 2; + gnu_u1 < 2; + gnu_u1 > 2; + gnu_u1 >= 2; + gnu_u1 <=> 2; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'int' to binary 'operator<=>'} } + gnu_u1 << 2; + gnu_u1 >> 2; + gnu_u1 && 2; + gnu_u1 || 2; + + gnu_u1 + uc; + gnu_u1 - uc; + gnu_u1 * uc; + gnu_u1 / uc; + gnu_u1 % uc; + gnu_u1 & uc; + gnu_u1 | uc; + gnu_u1 ^ uc; + gnu_u1 == uc; + gnu_u1 != uc; + gnu_u1 <= uc; + gnu_u1 < uc; + gnu_u1 > uc; + gnu_u1 >= uc; + gnu_u1 <=> uc; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'unsigned char' to binary 'operator<=>'} } + gnu_u1 << uc; + gnu_u1 >> uc; + gnu_u1 && uc; + gnu_u1 || uc; + + // Scalar-vector binary 'operatorarithmetic. + + 3 + sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\+'} } + 3 - sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator-'} } + 3 * sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\*'} } + 3 / sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator/'} } + 3 % sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator%'} } + 3 & sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\&'} } + 3 | sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\|'} } + 3 ^ sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator\^'} } + 3 == sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator=='} } + 3 != sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator!='} } + 3 <= sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<='} } + 3 <=> sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<=>'} } + 3 < sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<'} } + 3 > sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>'} } + 3 >= sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>='} } + 3 << sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator<<'} } + 3 >> sve_u1; // { dg-error {invalid operands of types 'int' and 'svuint8_t' to binary 'operator>>'} } + 3 && sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + 3 || sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + 3 + gnu_u1; + 3 - gnu_u1; + 3 * gnu_u1; + 3 / gnu_u1; + 3 % gnu_u1; + 3 & gnu_u1; + 3 | gnu_u1; + 3 ^ gnu_u1; + 3 == gnu_u1; + 3 != gnu_u1; + 3 <= gnu_u1; + 3 <=> gnu_u1; // { dg-error {invalid operands of types 'int' and 'gnu_uint8_t'[^\n]* to binary 'operator<=>'} } + 3 < gnu_u1; + 3 > gnu_u1; + 3 >= gnu_u1; + 3 << gnu_u1; + 3 >> gnu_u1; + 3 && gnu_u1; + 3 || gnu_u1; + + // Mismatched types. + + sve_u1 + sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\+'} } + sve_u1 - sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator-'} } + sve_u1 * sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\*'} } + sve_u1 / sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator/'} } + sve_u1 % sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator%'} } + sve_u1 & sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\&'} } + sve_u1 | sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\|'} } + sve_u1 ^ sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator\^'} } + sve_u1 == sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator=='} } + sve_u1 != sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator!='} } + sve_u1 <= sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<='} } + sve_u1 < sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<'} } + sve_u1 > sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>'} } + sve_u1 >= sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>='} } + sve_u1 <=> sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<=>'} } + sve_u1 << sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator<<'} } + sve_u1 >> sve_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'svint8_t' to binary 'operator>>'} } + + sve_u1 + gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\+'} } + sve_u1 - gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator-'} } + sve_u1 * gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\*'} } + sve_u1 / gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator/'} } + sve_u1 % gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator%'} } + sve_u1 & gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\&'} } + sve_u1 | gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\|'} } + sve_u1 ^ gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator\^'} } + sve_u1 == gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator=='} } + sve_u1 != gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator!='} } + sve_u1 <= gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<='} } + sve_u1 < gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<'} } + sve_u1 > gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>'} } + sve_u1 >= gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>='} } + sve_u1 <=> gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<=>'} } + sve_u1 << gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator<<'} } + sve_u1 >> gnu_s1; // { dg-error {invalid operands of types 'svuint8_t' and 'gnu_int8_t'[^\n]* to binary 'operator>>'} } + + gnu_u1 + sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\+'} } + gnu_u1 - sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator-'} } + gnu_u1 * sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\*'} } + gnu_u1 / sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator/'} } + gnu_u1 % sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator%'} } + gnu_u1 & sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\&'} } + gnu_u1 | sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\|'} } + gnu_u1 ^ sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator\^'} } + gnu_u1 == sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator=='} } + gnu_u1 != sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator!='} } + gnu_u1 <= sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<='} } + gnu_u1 < sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<'} } + gnu_u1 > sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>'} } + gnu_u1 >= sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>='} } + gnu_u1 <=> sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<=>'} } + gnu_u1 << sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator<<'} } + gnu_u1 >> sve_s1; // { dg-error {invalid operands of types 'gnu_uint8_t'[^\n]* and 'svint8_t' to binary 'operator>>'} } + + gnu_u1 + gnu_s1; + gnu_u1 - gnu_s1; + gnu_u1 * gnu_s1; + gnu_u1 / gnu_s1; + gnu_u1 % gnu_s1; + gnu_u1 & gnu_s1; + gnu_u1 | gnu_s1; + gnu_u1 ^ gnu_s1; + gnu_u1 == gnu_s1; + gnu_u1 != gnu_s1; + gnu_u1 <= gnu_s1; + gnu_u1 < gnu_s1; + gnu_u1 > gnu_s1; + gnu_u1 >= gnu_s1; + // This is a target-independent sorry. There's no ACLE reason why it + // needs to be kept. + gnu_u1 <=> gnu_s1; // { dg-message {three-way comparison of vectors} } + gnu_u1 << gnu_s1; + gnu_u1 >> gnu_s1; + + // Conditional expressions. + + uc ? sve_u1 : sve_u1; + uc ? gnu_u1 : sve_u1; // { dg-error {operands to '\?:' have different types 'gnu_uint8_t'[^\n]* and 'svuint8_t'} "" { xfail *-*-* } } + uc ? sve_u1 : gnu_u1; // { dg-error {operands to '\?:' have different types 'svuint8_t' and 'gnu_uint8_t'} "" { xfail *-*-* } } + uc ? gnu_u1 : gnu_u1; + + sve_u1 ? sve_u1 : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? sve_u1 : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? sve_u1 : uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? uc : sve_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? gnu_u1 : uc; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + sve_u1 ? uc : gnu_u1; // { dg-error {could not convert 'sve_u1' from 'svuint8_t' to 'bool'} } + + gnu_u1 ? sve_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : gnu_u1; + gnu_u1 ? sve_u1 : uc; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? uc : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : uc; + gnu_u1 ? uc : gnu_u1; + + // Vector built-ins. + + __builtin_shuffle (sve_u1, sve_u1, sve_u1); // { dg-error {'__builtin_shuffle' last argument must be an integer vector} } + __builtin_shuffle (sve_u1, gnu_u1, gnu_u1); // { dg-error {'__builtin_shuffle' arguments must be vectors} } + __builtin_shuffle (gnu_u1, sve_u1, gnu_u1); // { dg-error {'__builtin_shuffle' arguments must be vectors} } + __builtin_shuffle (gnu_u1, gnu_u1, sve_u1); // { dg-error {'__builtin_shuffle' last argument must be an integer vector} } + __builtin_shuffle (gnu_u1, gnu_u1, gnu_u1); + + __builtin_convertvector (sve_u1, svuint8_t); // { dg-error {'__builtin_convertvector' first argument must be an integer or floating vector} } + __builtin_convertvector (gnu_u1, svuint8_t); // { dg-error {'__builtin_convertvector' second argument must be an integer or floating vector type} } + __builtin_convertvector (sve_u1, gnu_uint8_t); // { dg-error {'__builtin_convertvector' first argument must be an integer or floating vector} } + __builtin_convertvector (gnu_u1, gnu_uint8_t); + + // Type queries. + + static_assert(__is_literal_type(svuint8_t)); + static_assert(__is_literal_type(gnu_uint8_t)); + + svuint8_t *sve_ptr1 = &sve_u1; + svuint8_t *sve_ptr2 = &gnu_u1; + svuint8_t *sve_ptr3 = &sve_s1; // { dg-error {invalid conversion from 'svint8_t\*' to 'svuint8_t\*'} } + svuint8_t *sve_ptr4 = &gnu_s1; // { dg-error {invalid conversion from 'gnu_int8_t\*'[^\n]* to 'svuint8_t\*'} } + + gnu_uint8_t *gnu_ptr1 = &sve_u1; + gnu_uint8_t *gnu_ptr2 = &gnu_u1; + gnu_uint8_t *gnu_ptr3 = &sve_s1; // { dg-error {invalid conversion from 'svint8_t\*' to 'gnu_uint8_t\*'} } + gnu_uint8_t *gnu_ptr4 = &gnu_s1; // { dg-error {invalid conversion from 'gnu_int8_t\*'[^\n]* to 'gnu_uint8_t\*'} } +} + +constexpr svuint8_t const1 (svuint8_t x) { return x; } +constexpr gnu_uint8_t const2 (gnu_uint8_t x) { return x; }