| 1 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -ffreestanding -fsyntax-only -verify -std=c++11 -mvscale-min=4 -mvscale-max=4 -Wconversion %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
#include <stdint.h> |
| 5 |
|
| 6 |
#define N __ARM_FEATURE_SVE_BITS |
| 7 |
|
| 8 |
typedef __SVInt8_t svint8_t; |
| 9 |
typedef svint8_t fixed_int8_t __attribute__((arm_sve_vector_bits(N))); |
| 10 |
typedef int8_t gnu_int8_t __attribute__((vector_size(N / 8))); |
| 11 |
|
| 12 |
typedef __SVBool_t svbool_t; |
| 13 |
typedef svbool_t fixed_bool_t __attribute__((arm_sve_vector_bits(N))); |
| 14 |
typedef int8_t gnu_bool_t __attribute__((vector_size(N / 64))); |
| 15 |
|
| 16 |
template<typename T> struct S { T var; }; |
| 17 |
|
| 18 |
S<fixed_int8_t> s; |
| 19 |
|
| 20 |
// Test implicit casts between VLA and VLS vectors |
| 21 |
svint8_t to_svint8_t(fixed_int8_t x) { return x; } |
| 22 |
fixed_int8_t from_svint8_t(svint8_t x) { return x; } |
| 23 |
|
| 24 |
// Test implicit casts between GNU and VLA vectors |
| 25 |
svint8_t to_svint8_t__from_gnu_int8_t(gnu_int8_t x) { return x; } |
| 26 |
gnu_int8_t from_svint8_t__to_gnu_int8_t(svint8_t x) { return x; } |
| 27 |
|
| 28 |
// Test implicit casts between GNU and VLS vectors |
| 29 |
fixed_int8_t to_fixed_int8_t__from_gnu_int8_t(gnu_int8_t x) { return x; } |
| 30 |
gnu_int8_t from_fixed_int8_t__to_gnu_int8_t(fixed_int8_t x) { return x; } |
| 31 |
|
| 32 |
// Test implicit casts between VLA and VLS predicates |
| 33 |
svbool_t to_svbool_t(fixed_bool_t x) { return x; } |
| 34 |
fixed_bool_t from_svbool_t(svbool_t x) { return x; } |
| 35 |
|
| 36 |
// Test implicit casts between GNU and VLA predicates |
| 37 |
svbool_t to_svbool_t__from_gnu_bool_t(gnu_bool_t x) { return x; } |
| 38 |
gnu_bool_t from_svbool_t__to_gnu_bool_t(svbool_t x) { return x; } |