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
6 #define N __ARM_FEATURE_SVE_BITS
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)));
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)));
16 template<typename T
> struct S
{ T var
; };
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
; }
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
; }
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
; }
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
; }
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
; }