diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-10-17 17:54:57 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-10-17 17:54:57 +0000 |
commit | ba3236375985e92ce121e96172900732967d1e73 (patch) | |
tree | dcad2d61dd84ad30843fadabc4f8c7afcb4f4c2f /test/Sema | |
parent | f78232dcbf734a1c7e42ae60b58c9bbe14b64516 (diff) | |
download | clang-ba3236375985e92ce121e96172900732967d1e73.tar.gz |
[OpenCL] Restrict swizzle length check to OpenCL mode
Changes behavior introduced in r298369 to only error out on
vector component invalid length access on OpenCL mode.
Differential Revision: https://reviews.llvm.org/D38868
rdar://problem/33568748
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/vector_swizzle_length.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/vector_swizzle_length.c b/test/Sema/vector_swizzle_length.c new file mode 100644 index 0000000000..5e6b1e7d67 --- /dev/null +++ b/test/Sema/vector_swizzle_length.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -x c %s -verify -pedantic -fsyntax-only +// expected-no-diagnostics + +typedef float float8 __attribute__((ext_vector_type(8))); + +void foo() { + float8 f2 = (float8){0, 0, 0, 0, 0, 0, 0, 0}; + (void)f2.s01234; + (void)f2.xyzxy; +} |