Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 1 | // RUN: clang %s -fsyntax-only -verify |
Nate Begeman | d47d4f5 | 2008-01-25 05:34:48 +0000 | [diff] [blame] | 2 | |
Nate Begeman | 213541a | 2008-04-18 23:10:10 +0000 | [diff] [blame] | 3 | typedef __attribute__(( ext_vector_type(4) )) float float4; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 4 | //typedef float float4 __attribute__((vector_size(16))); |
Nate Begeman | d47d4f5 | 2008-01-25 05:34:48 +0000 | [diff] [blame] | 5 | |
| 6 | float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 }; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 7 | |
| 8 | float4 array[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0}; |
| 9 | int array_sizecheck[(sizeof(array) / sizeof(float4)) == 3? 1 : -1]; |
| 10 | |
| 11 | float4 array2[2] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, |
Douglas Gregor | b574e56 | 2009-01-30 22:26:29 +0000 | [diff] [blame] | 12 | 9.0 }; // expected-error {{excess elements in array initializer}} |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 13 | |
| 14 | float4 array3[2] = { {1.0, 2.0, 3.0}, 5.0, 6.0, 7.0, 8.0, |
Douglas Gregor | b574e56 | 2009-01-30 22:26:29 +0000 | [diff] [blame] | 15 | 9.0 }; // expected-error {{excess elements in array initializer}} |