2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc %s -fsyntax-only -verify
|
2008-01-25 13:34:48 +08:00
|
|
|
|
2009-02-19 06:23:55 +08:00
|
|
|
//typedef __attribute__(( ext_vector_type(4) )) float float4;
|
|
|
|
typedef float float4 __attribute__((vector_size(16)));
|
2008-01-25 13:34:48 +08:00
|
|
|
|
|
|
|
float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 };
|
2009-01-29 05:54:33 +08:00
|
|
|
|
2009-02-19 06:23:55 +08:00
|
|
|
float4 foo2 = (float4){ 1.0, 2.0, 3.0, 4.0 , 5.0 }; // expected-warning{{excess elements in vector initializer}}
|
|
|
|
|
2009-01-29 05:54:33 +08:00
|
|
|
float4 array[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
|
|
|
|
int array_sizecheck[(sizeof(array) / sizeof(float4)) == 3? 1 : -1];
|
|
|
|
|
|
|
|
float4 array2[2] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,
|
2009-02-19 06:23:55 +08:00
|
|
|
9.0 }; // expected-warning {{excess elements in array initializer}}
|
2009-01-29 05:54:33 +08:00
|
|
|
|
|
|
|
float4 array3[2] = { {1.0, 2.0, 3.0}, 5.0, 6.0, 7.0, 8.0,
|
2009-02-19 06:23:55 +08:00
|
|
|
9.0 }; // expected-warning {{excess elements in array initializer}}
|
2009-05-13 12:00:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
// rdar://6881069
|
|
|
|
__attribute__((vector_size(16))) // expected-error {{unsupported type 'float (void)' for vector_size attribute, please use on typedef}}
|
|
|
|
float f1(void) {
|
|
|
|
}
|
2009-10-22 13:17:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PR5265
|
|
|
|
typedef float __attribute__((ext_vector_type (3))) float3;
|
2009-10-23 03:56:49 +08:00
|
|
|
int test2[(sizeof(float3) == sizeof(float4))*2-1];
|
2009-10-22 13:17:15 +08:00
|
|
|
|