1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 \ 2 // RUN: -triple aarch64-arm-none-eabi -target-cpu cortex-a75 \ 3 // RUN: -target-feature +bf16 -target-feature +neon %s 4 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 \ 5 // RUN: -triple arm-arm-none-eabi -target-cpu cortex-a53 \ 6 // RUN: -target-feature +bf16 -target-feature +neon %s 7 8 void test(bool b) { 9 __bf16 bf16; 10 11 bf16 + bf16; // expected-error {{invalid operands to binary expression ('__bf16' and '__bf16')}} 12 bf16 - bf16; // expected-error {{invalid operands to binary expression ('__bf16' and '__bf16')}} 13 bf16 * bf16; // expected-error {{invalid operands to binary expression ('__bf16' and '__bf16')}} 14 bf16 / bf16; // expected-error {{invalid operands to binary expression ('__bf16' and '__bf16')}} 15 16 __fp16 fp16; 17 18 bf16 + fp16; // expected-error {{invalid operands to binary expression ('__bf16' and '__fp16')}} 19 fp16 + bf16; // expected-error {{invalid operands to binary expression ('__fp16' and '__bf16')}} 20 bf16 - fp16; // expected-error {{invalid operands to binary expression ('__bf16' and '__fp16')}} 21 fp16 - bf16; // expected-error {{invalid operands to binary expression ('__fp16' and '__bf16')}} 22 bf16 * fp16; // expected-error {{invalid operands to binary expression ('__bf16' and '__fp16')}} 23 fp16 * bf16; // expected-error {{invalid operands to binary expression ('__fp16' and '__bf16')}} 24 bf16 / fp16; // expected-error {{invalid operands to binary expression ('__bf16' and '__fp16')}} 25 fp16 / bf16; // expected-error {{invalid operands to binary expression ('__fp16' and '__bf16')}} 26 bf16 = fp16; // expected-error {{assigning to '__bf16' from incompatible type '__fp16'}} 27 fp16 = bf16; // expected-error {{assigning to '__fp16' from incompatible type '__bf16'}} 28 bf16 + (b ? fp16 : bf16); // expected-error {{incompatible operand types ('__fp16' and '__bf16')}} 29 } 30 31 #include <arm_neon.h> 32 33 void test_vector(bfloat16x4_t a, bfloat16x4_t b, float16x4_t c) { 34 a + b; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'bfloat16x4_t')}} 35 a - b; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'bfloat16x4_t')}} 36 a * b; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'bfloat16x4_t')}} 37 a / b; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'bfloat16x4_t')}} 38 39 a + c; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'float16x4_t' (vector of 4 'float16_t' values))}} 40 a - c; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'float16x4_t' (vector of 4 'float16_t' values))}} 41 a * c; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'float16x4_t' (vector of 4 'float16_t' values))}} 42 a / c; // expected-error {{invalid operands to binary expression ('bfloat16x4_t' (vector of 4 'bfloat16_t' values) and 'float16x4_t' (vector of 4 'float16_t' values))}} 43 c + b; // expected-error {{invalid operands to binary expression ('float16x4_t' (vector of 4 'float16_t' values) and 'bfloat16x4_t' (vector of 4 'bfloat16_t' values))}} 44 c - b; // expected-error {{invalid operands to binary expression ('float16x4_t' (vector of 4 'float16_t' values) and 'bfloat16x4_t' (vector of 4 'bfloat16_t' values))}} 45 c * b; // expected-error {{invalid operands to binary expression ('float16x4_t' (vector of 4 'float16_t' values) and 'bfloat16x4_t' (vector of 4 'bfloat16_t' values))}} 46 c / b; // expected-error {{invalid operands to binary expression ('float16x4_t' (vector of 4 'float16_t' values) and 'bfloat16x4_t' (vector of 4 'bfloat16_t' values))}} 47 } 48