| 1 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - %s |
| 2 |
|
| 3 |
// REQUIRES: aarch64-registered-target |
| 4 |
|
| 5 |
#include <arm_neon.h> |
| 6 |
|
| 7 |
// Bitcast between FP8 Neon vectors |
| 8 |
mfloat8x8_t err_test_f8_f8(mfloat8x16_t x) { |
| 9 |
return (mfloat8x8_t) x; |
| 10 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}} |
| 11 |
} |
| 12 |
|
| 13 |
mfloat8x16_t err_testq_f8_f8(mfloat8x8_t x) { |
| 14 |
return (mfloat8x16_t) x; |
| 15 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}} |
| 16 |
} |
| 17 |
|
| 18 |
// Bitcast between FP8 and int8 Neon vectors |
| 19 |
mfloat8x8_t err_test_f8_s8(int8x16_t x) { |
| 20 |
return (mfloat8x8_t) x; |
| 21 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'int8x16_t' (vector of 16 'int8_t' values) of different size}} |
| 22 |
} |
| 23 |
|
| 24 |
int8x8_t err_test_s8_f8(mfloat8x16_t x) { |
| 25 |
return (int8x8_t) x; |
| 26 |
// expected-error@-1 {{invalid conversion between vector type 'int8x8_t' (vector of 8 'int8_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}} |
| 27 |
} |
| 28 |
|
| 29 |
mfloat8x16_t err_testq_f8_s8(int8x8_t x) { |
| 30 |
return (mfloat8x16_t) x; |
| 31 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'int8x8_t' (vector of 8 'int8_t' values) of different size}} |
| 32 |
} |
| 33 |
|
| 34 |
int8x16_t err_testq_s8_f8(mfloat8x8_t x) { |
| 35 |
return (int8x16_t) x; |
| 36 |
// expected-error@-1 {{invalid conversion between vector type 'int8x16_t' (vector of 16 'int8_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}} |
| 37 |
} |
| 38 |
|
| 39 |
// Bitcast between FP8 and float32 Neon vectors |
| 40 |
mfloat8x8_t err_test_f8_f32(float32x4_t x) { |
| 41 |
return (mfloat8x8_t) x; |
| 42 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'float32x4_t' (vector of 4 'float32_t' values) of different size}} |
| 43 |
} |
| 44 |
|
| 45 |
float32x2_t err_test_f32_f8(mfloat8x16_t x) { |
| 46 |
return (float32x2_t) x; |
| 47 |
// expected-error@-1 {{invalid conversion between vector type 'float32x2_t' (vector of 2 'float32_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}} |
| 48 |
} |
| 49 |
|
| 50 |
mfloat8x16_t err_testq_f8_f32(float32x2_t x) { |
| 51 |
return (mfloat8x16_t) x; |
| 52 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'float32x2_t' (vector of 2 'float32_t' values) of different size}} |
| 53 |
} |
| 54 |
|
| 55 |
float32x4_t err_testq_f32_f8(mfloat8x8_t x) { |
| 56 |
return (float32x4_t) x; |
| 57 |
// expected-error@-1 {{invalid conversion between vector type 'float32x4_t' (vector of 4 'float32_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}} |
| 58 |
} |
| 59 |
|
| 60 |
// Bitcast between FP8 and poly128_t (which is integral) |
| 61 |
mfloat8x8_t err_testq_f8_p128(poly128_t x) { |
| 62 |
return (mfloat8x8_t) x; |
| 63 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and integer type 'poly128_t' (aka 'unsigned __int128') of different size}} |
| 64 |
} |
| 65 |
|
| 66 |
poly128_t err_testq_p128_f8(mfloat8x8_t x) { |
| 67 |
return (poly128_t) x; |
| 68 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and integer type 'poly128_t' (aka 'unsigned __int128') of different size}} |
| 69 |
} |
| 70 |
|
| 71 |
// Bitcast between FP8 and a non-integral type |
| 72 |
mfloat8x8_t err_test_f8_ptr(void *p) { |
| 73 |
return (mfloat8x8_t) p; |
| 74 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'void *'}} |
| 75 |
} |
| 76 |
|
| 77 |
void *err_test_ptr_f8(mfloat8x8_t v) { |
| 78 |
return (void *) v; |
| 79 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'void *'}} |
| 80 |
} |
| 81 |
|
| 82 |
mfloat8x8_t err_test_f8_dbl(double v) { |
| 83 |
return (mfloat8x8_t) v; |
| 84 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'double'}} |
| 85 |
} |
| 86 |
|
| 87 |
double err_test_dbl_f8(mfloat8x8_t v) { |
| 88 |
return (double) v; |
| 89 |
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'double'}} |
| 90 |
} |
| 91 |
|
| 92 |
struct S { |
| 93 |
char ch[16]; |
| 94 |
}; |
| 95 |
|
| 96 |
mfloat8x16_t err_test_f8_agg(struct S s) { |
| 97 |
return (mfloat8x16_t) s; |
| 98 |
// expected-error@-1 {{operand of type 'struct S' where arithmetic or pointer type is required}} |
| 99 |
} |
| 100 |
|
| 101 |
struct S err_test_agg_f8(mfloat8x16_t v) { |
| 102 |
return (struct S) v; |
| 103 |
// expected-error@-1 {{used type 'struct S' where arithmetic or pointer type is required}} |
| 104 |
} |