brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 0ca55e6 Raw
38 lines · cpp
1// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sve -verify2 3typedef int fixed_vector __attribute__((vector_size(4)));4 5auto error_fixed_vector_result(__SVBool_t svbool, fixed_vector a, fixed_vector b) {6  // expected-error@+1 {{vector condition type '__SVBool_t' and result type 'fixed_vector' (vector of 1 'int' value) do not have the same number of elements}}7  return svbool ? a : b;8}9 10auto error_void_result(__SVBool_t svbool) {11  // expected-error@+1 {{GNU vector conditional operand cannot be void}}12  return svbool ? (void)0 : (void)1;13}14 15auto error_sve_splat_result_unsupported(__SVBool_t svbool, long long a, long long b) {16  // expected-error@+1 {{scalar type 'long long' not supported with vector condition type '__SVBool_t'}}17  return svbool ? a : b;18}19 20auto error_sve_vector_result_matched_element_count(__SVBool_t svbool, __SVUint32_t a, __SVUint32_t b) {21  // expected-error@+1 {{vector condition type '__SVBool_t' and result type '__SVUint32_t' do not have the same number of elements}}22  return svbool ? a : b;23}24 25// The following cases should be supported:26 27__SVBool_t cond_svbool(__SVBool_t a, __SVBool_t b) {28    return a < b ? a : b;29}30 31__SVFloat32_t cond_svf32(__SVFloat32_t a, __SVFloat32_t b) {32    return a < b ? a : b;33}34 35__SVUint64_t cond_u64_splat(__SVUint64_t a) {36    return a < 1ul ? a : 1ul;37}38