1 // RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +neon -fsyntax-only -verify
2 
3 typedef float float32_t;
4 typedef unsigned char poly8_t;
5 typedef unsigned short poly16_t;
6 typedef unsigned long long uint64_t;
7 
8 // Define some valid Neon types.
9 typedef __attribute__((neon_vector_type(2))) int int32x2_t;
10 typedef __attribute__((neon_vector_type(4))) int int32x4_t;
11 typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
12 typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
13 typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
14 typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
15 typedef __attribute__((neon_polyvector_type(16))) poly8_t  poly8x16_t;
16 typedef __attribute__((neon_polyvector_type(8)))  poly16_t poly16x8_t;
17 
18 // The attributes must have a single argument.
19 typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute takes one argument}}
20 
21 // The number of elements must be an ICE.
22 typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{attribute requires an integer constant}}
23 
24 // Only certain element types are allowed.
25 typedef __attribute__((neon_vector_type(2))) double double_elt;
26 typedef __attribute__((neon_vector_type(4))) void* ptr_elt; // expected-error{{invalid vector element type}}
27 typedef __attribute__((neon_polyvector_type(4))) float32_t bad_poly_elt; // expected-error{{invalid vector element type}}
28 struct aggr { signed char c; };
29 typedef __attribute__((neon_vector_type(8))) struct aggr aggregate_elt; // expected-error{{invalid vector element type}}
30 
31 // The total vector size must be 64 or 128 bits.
32 typedef __attribute__((neon_vector_type(1))) int int32x1_t; // expected-error{{Neon vector size must be 64 or 128 bits}}
33 typedef __attribute__((neon_vector_type(3))) int int32x3_t; // expected-error{{Neon vector size must be 64 or 128 bits}}
34