blob: f22c1fc4db8a6eb5f2daed1562675250df0df301 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -faltivec -verify -pedantic -fsyntax-only
Nate Begeman2ef13e52009-08-10 23:49:36 +00002
3typedef int v4 __attribute((vector_size(16)));
4typedef short v8 __attribute((vector_size(16)));
5
6v8 foo(void) {
7 v8 a;
8 v4 b;
9 a = (v8){4, 2}; // expected-error {{too few elements in vector initialization (expected 8 elements, have 2)}}
10 b = (v4)(5, 6, 7, 8, 9); // expected-warning {{excess elements in vector initializer}}
11 b = (v4)(5, 6, 8, 8.0f);
12 return (v8){0, 1, 2, 3, 1, 2, 3, 4};
13
14 // FIXME: test that (type)(fn)(args) still works with -faltivec
15 // FIXME: test that c++ overloaded commas still work -faltivec
16}