blob: 6913082228cace5331df63b25c17087124b58542 [file] [log] [blame]
Douglas Gregor4c678342009-01-28 21:54:33 +00001// RUN: clang %s -fsyntax-only -verify
Nate Begemand47d4f52008-01-25 05:34:48 +00002
Nate Begeman213541a2008-04-18 23:10:10 +00003typedef __attribute__(( ext_vector_type(4) )) float float4;
Douglas Gregor4c678342009-01-28 21:54:33 +00004//typedef float float4 __attribute__((vector_size(16)));
Nate Begemand47d4f52008-01-25 05:34:48 +00005
6float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 };
Douglas Gregor4c678342009-01-28 21:54:33 +00007
8float4 array[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
9int array_sizecheck[(sizeof(array) / sizeof(float4)) == 3? 1 : -1];
10
11float4 array2[2] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0,
12 9.0 }; // expected-warning {{excess elements in array initializer}}
13
14float4 array3[2] = { {1.0, 2.0, 3.0}, 5.0, 6.0, 7.0, 8.0,
15 9.0 }; // expected-warning {{excess elements in array initializer}}