1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -ffreestanding -fsyntax-only -verify -std=c++11 -msve-vector-bits=512 -fallow-half-arguments-and-returns %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 template<typename T> struct S { T var; }; 13 14 S<fixed_int8_t> s; 15 16 // Test implicit casts between VLA and VLS vectors to_svint8_t(fixed_int8_t x)17svint8_t to_svint8_t(fixed_int8_t x) { return x; } from_svint8_t(svint8_t x)18fixed_int8_t from_svint8_t(svint8_t x) { return x; } 19 20 // Test implicit casts between GNU and VLA vectors to_svint8_t__from_gnu_int8_t(gnu_int8_t x)21svint8_t to_svint8_t__from_gnu_int8_t(gnu_int8_t x) { return x; } from_svint8_t__to_gnu_int8_t(svint8_t x)22gnu_int8_t from_svint8_t__to_gnu_int8_t(svint8_t x) { return x; } 23 24 // Test implicit casts between GNU and VLS vectors to_fixed_int8_t__from_gnu_int8_t(gnu_int8_t x)25fixed_int8_t to_fixed_int8_t__from_gnu_int8_t(gnu_int8_t x) { return x; } from_fixed_int8_t__to_gnu_int8_t(fixed_int8_t x)26gnu_int8_t from_fixed_int8_t__to_gnu_int8_t(fixed_int8_t x) { return x; } 27