diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-06-13 10:38:46 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-06-13 10:38:46 +0000 |
commit | 6b5374f837f925d99b1a76bc2fe8c98c1698df7f (patch) | |
tree | f5b66f1cfd643795ab115ce1a815133c6e1c1fea /test/Sema/init-vector.c | |
parent | 148772a841cae6f32db16d890e788b92a763bb3f (diff) |
Allow initializing a vector with a vector in addition to allowing a list
of the elements. Issue reported on cfe-dev by Mattias Holm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/init-vector.c')
-rw-r--r-- | test/Sema/init-vector.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/init-vector.c b/test/Sema/init-vector.c new file mode 100644 index 0000000000..691ea97268 --- /dev/null +++ b/test/Sema/init-vector.c @@ -0,0 +1,17 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +typedef float __attribute__((vector_size (16))) v4f_t; + +typedef union { + struct { + float x, y, z, w; + }s; + v4f_t v; +} vector_t; + + +vector_t foo(v4f_t p) +{ + vector_t v = {.v = p}; + return v; +} |