diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Sema/vector-init.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/Sema/vector-init.c')
-rw-r--r-- | test/Sema/vector-init.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Sema/vector-init.c b/test/Sema/vector-init.c new file mode 100644 index 0000000..6eab324 --- /dev/null +++ b/test/Sema/vector-init.c @@ -0,0 +1,23 @@ +// RUN: clang-cc %s -fsyntax-only -verify + +//typedef __attribute__(( ext_vector_type(4) )) float float4; +typedef float float4 __attribute__((vector_size(16))); + +float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 }; + +float4 foo2 = (float4){ 1.0, 2.0, 3.0, 4.0 , 5.0 }; // expected-warning{{excess elements in vector initializer}} + +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, + 9.0 }; // expected-warning {{excess elements in array initializer}} + +float4 array3[2] = { {1.0, 2.0, 3.0}, 5.0, 6.0, 7.0, 8.0, + 9.0 }; // expected-warning {{excess elements in array initializer}} + + +// rdar://6881069 +__attribute__((vector_size(16))) // expected-error {{unsupported type 'float (void)' for vector_size attribute, please use on typedef}} +float f1(void) { +} |