diff options
author | Egor Churaev <egor.churaev@gmail.com> | 2017-03-21 13:20:57 +0000 |
---|---|---|
committer | Egor Churaev <egor.churaev@gmail.com> | 2017-03-21 13:20:57 +0000 |
commit | d4273d587c5406143d44d7836bacba43cd9a145d (patch) | |
tree | 5a8a6c2b0fbf6d9177b86931409db0bf2ef39bb5 /test/SemaOpenCL | |
parent | 40cf0c36256645a229357c029ef83f6a324c818b (diff) |
[OpenCL] Added diagnostic for checking length of vector
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: bader, yaxunl
Differential Revision: https://reviews.llvm.org/D30937
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/vector_swizzle_length.cl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaOpenCL/vector_swizzle_length.cl b/test/SemaOpenCL/vector_swizzle_length.cl new file mode 100644 index 0000000000..94e3f654d5 --- /dev/null +++ b/test/SemaOpenCL/vector_swizzle_length.cl @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only + +typedef float float8 __attribute__((ext_vector_type(8))); + +void foo() { + float8 f2 = (float8)(0, 0, 0, 0, 0, 0, 0, 0); + + f2.s01234; // expected-error {{vector component access has invalid length 5. Supported: 1,2,3,4,8,16}} + f2.xyzxy; // expected-error {{vector component access has invalid length 5. Supported: 1,2,3,4,8,16}} +} |